WO2021189912A1 - Method and apparatus for detecting target object in image, and electronic device and storage medium - Google Patents

Method and apparatus for detecting target object in image, and electronic device and storage medium Download PDF

Info

Publication number
WO2021189912A1
WO2021189912A1 PCT/CN2020/131992 CN2020131992W WO2021189912A1 WO 2021189912 A1 WO2021189912 A1 WO 2021189912A1 CN 2020131992 W CN2020131992 W CN 2020131992W WO 2021189912 A1 WO2021189912 A1 WO 2021189912A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
image
standard
training image
feature map
Prior art date
Application number
PCT/CN2020/131992
Other languages
French (fr)
Chinese (zh)
Inventor
刁勍琛
伍世宾
黄凌云
刘玉宇
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021189912A1 publication Critical patent/WO2021189912A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation

Definitions

  • This application relates to the field of image analysis technology, and in particular to a method, device, electronic equipment, and computer-readable storage medium for detecting a target in an image.
  • a method for detecting a target in an image provided by this application includes:
  • the target detection model Performing target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes predicted center point information, predicted size information, and predicted boundary information of the target;
  • An image of the target to be detected is acquired, and the standard target detection model is used to perform image detection on the image of the target to be detected to obtain a standard detection result.
  • the present application also provides a device for detecting a target in an image, the device including:
  • the image noise reduction module is used to obtain training images, perform noise reduction processing on the training images to obtain standard training images, wherein the training images include standard center point information, standard size information, and standard boundary information of the target;
  • Model building module used to build a target detection model
  • the target detection module is used to perform target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes the predicted center point information, predicted size information, and predicted boundary of the target information;
  • a loss function construction module configured to construct a target loss function according to the detection result and the standard training image
  • a model optimization module is used to calculate the loss value of the target loss function, and optimize the target detection model according to the loss value to obtain a standard target detection model;
  • the standard detection module is used to obtain an image of a target object to be detected, and use the standard target object detection model to perform image detection on the image of the target object to be detected to obtain a standard detection result.
  • This application also provides an electronic device, which includes:
  • At least one processor and,
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute the following steps:
  • the target detection model Performing target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes predicted center point information, predicted size information, and predicted boundary information of the target;
  • An image of the target to be detected is acquired, and the standard target detection model is used to perform image detection on the image of the target to be detected to obtain a standard detection result.
  • the present application also provides a computer-readable storage medium, including a storage data area and a storage program area, wherein the storage data area stores created data, and the storage program area stores a computer program; wherein, When the computer program is executed by the processor, the following steps are implemented:
  • the target detection model Performing target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes predicted center point information, predicted size information, and predicted boundary information of the target;
  • An image of the target to be detected is acquired, and the standard target detection model is used to perform image detection on the image of the target to be detected to obtain a standard detection result.
  • FIG. 1 is a schematic flowchart of a method for detecting a target in an image provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of a flow of noise reduction processing on training images provided by an embodiment of the application
  • FIG. 3 is a schematic diagram of a process of using a target detection model to perform target detection on a standard training image according to an embodiment of the application;
  • FIG. 4 is a schematic diagram of modules of a detection device for a target in an image provided by an embodiment of the application;
  • FIG. 5 is a schematic diagram of the internal structure of an electronic device that implements a method for detecting a target object in an image provided by an embodiment of the application;
  • the execution subject of the method for detecting a target in an image provided by the embodiment of the application includes but is not limited to at least one of the electronic devices that can be configured to execute the method provided by the embodiment of the application, such as a server and a terminal.
  • the detection method of the target in the image can be executed by software or hardware installed in the terminal device or the server device, and the software can be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
  • This application provides a method for detecting a target in an image.
  • FIG. 1 it is a schematic flowchart of a method for detecting a target in an image provided by an embodiment of this application.
  • the method can be executed by a device, and the device can be implemented by software and/or hardware.
  • the method for detecting the target in the image includes:
  • a java sentence with a data capture function is used to obtain training images from a blockchain node for storing training images, and the high data throughput of the blockchain node can improve the efficiency of obtaining training images.
  • the training image is an image including a target object, and the training image also includes standard center point information, standard size information, and standard boundary information of the target object.
  • the training image is a histopathological image containing a target lesion
  • the histopathological image includes standard center point information of the target lesion, standard size information of the target lesion, and standard boundary information of the target lesion.
  • FIG. 2 is a schematic diagram of a flow of noise reduction processing on training images provided by an embodiment of the application
  • the denoising processing on the training image to obtain a standard training image includes:
  • the first value is 1, and the second value is 0.
  • the calculating the average value of pixels in the preset neighborhood of the target pixel point includes:
  • the following average value calculation formula is used to calculate the average value of pixels in the preset neighborhood:
  • f(j,k) is the pixel point (j,k) in the preset neighborhood
  • g(x,y) is the average value of the pixel
  • W is the preset neighborhood
  • j,k is the pixel in the preset neighborhood
  • med is the mean value processing operation
  • N is the number of pixels in the preset neighborhood.
  • the embodiment of the application performs noise reduction processing on the training image to obtain a standard training image, which can reduce noise in the training image, highlight the target in the training image, and improve the accuracy of the model trained using the standard training image.
  • the target detection model includes a plurality of parallel convolution channels with different resolutions.
  • the target detection model adopts the HRnet network structure, and the HRnet network uses multi-channel, multi-resolution branch parallel convolution to convolve the same feature, so as to obtain the same feature of the target with different resolutions.
  • the HRnet network used in the embodiments of the present application changes from a traditional serial connection convolution to a parallel connection convolution, thereby obtaining rich high-resolution representations and improving the accuracy of target detection by the model.
  • FIG. 3 is a schematic diagram of a process of using a target detection model to perform target detection on a standard training image according to an embodiment of the application.
  • the use of the target detection model to perform target detection on the standard training image to obtain a detection result includes:
  • the image segmentation algorithm includes, but is not limited to, a region-based image segmentation algorithm, a threshold-based image segmentation algorithm, and an edge-based image segmentation algorithm.
  • the forward parallel convolution channel and the backward parallel convolution channel are relative terms.
  • the target detection model includes 4 parallel convolution channels, and the previous one is a parallel convolution that performs convolution on a standard training image.
  • the parallel convolution channel that convolves the standard training image is the forward parallel convolution channel; the latter parallel convolution channel that convolves the standard training image is relative to the previous one that convolves the standard training image.
  • the parallel convolution channel of is referred to as the backward parallel convolution channel.
  • the forward parallel convolution channel is the initial parallel convolution channel
  • the backward convolution convolves the result obtained in the forward direction and the input of the forward parallel convolution channel to obtain a feature map.
  • the backward convolution performs convolution on the result obtained in the forward direction and the input of all forward convolution channels to obtain a feature map.
  • the standard training image is convolved in the first parallel convolution channel to obtain the first feature map
  • the first parallel convolution channel, the first parallel convolution channel, the first parallel convolution channel, and the first parallel convolution channel are connected in parallel to obtain four feature maps of the same feature with different resolutions.
  • the resolution of the feature map obtained by the multi-layer parallel convolution channel output by the target detection model is gradually reduced, and the feature information is gradually enhanced. Therefore, the feature map obtained through the multi-layer parallel convolution channel in the embodiment of the present application contains both high-resolution position information and low-resolution feature information, which is more conducive to the subsequent use of the feature map for target detection and improves The accuracy of the target detection model.
  • the target loss function includes: a center point loss function, a size loss function, and a boundary loss function.
  • the target loss function is:
  • L det is the center point loss function
  • L size is the size loss function
  • L bce is the boundary loss function
  • C is the number of target categories
  • H is the length of the standard training image
  • W is the standard training image
  • N is the number of the standard training images
  • ⁇ and ⁇ are preset constants
  • p cij is the prediction center point information
  • y cij is the standard center point information
  • s k is the prediction size information
  • p ij is prediction boundary information
  • y ij is standard boundary information.
  • the embodiment of the application uses a combination of a center point loss function, a size loss function, and a boundary loss function as the target loss function. At the same time, three loss values of the center point position, size, and boundary position of the target are used, and the three loss values are used to target the target. The parameters of the object detection model are updated, which is beneficial to improve the accuracy of the target object detection model.
  • an optimization algorithm is used to optimize the parameters of the target detection model
  • the Adam optimization algorithm when the loss value of the target loss function is greater than the preset loss threshold, the Adam optimization algorithm is used to optimize the parameters of the target detection model.
  • the Adam optimization algorithm can adaptively adjust the target detection model training process
  • the learning rate makes the target detection model more accurate and improves the performance of the target detection model.
  • the image of the target object to be detected includes a medical image of a biological tissue.
  • the image of the lesion to be detected can be uploaded by the user through a user-side program.
  • the image of the lesion to be detected is obtained, the image of the lesion to be detected is input to a standard lesion detection model for lesion detection, and a standard detection result is obtained.
  • the embodiment of the application improves the quality of the training image by denoising the training image, and further improves the accuracy of the target detection model trained by the training image; the target detection model is calculated separately by constructing the target loss function to output the target.
  • the three loss values of predicted center point information, predicted size information and predicted boundary information are used to update the parameters of the target detection model by using the three loss values to improve the size, size and position of the target output by the target detection model.
  • the accuracy of the target object to be detected is acquired, and the standard target object detection model is used to perform image detection on the image of the target object to be detected, without manual image analysis, which improves the detection efficiency of the target object in the image. Therefore, the method for detecting a target in an image proposed in this application can improve the efficiency and accuracy of detecting the target in the image.
  • FIG. 4 it is a schematic diagram of the module of the detection device for the target in the image of the present application.
  • the device 100 for detecting a target in an image described in this application can be installed in an electronic device.
  • the detection device of the target in the image may include the image noise reduction module 101, the model construction module 102, the target detection module 103, the loss function construction module 104, the model optimization module 105, and the standard detection module 106.
  • the module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the image noise reduction module 101 is used to obtain training images, perform noise reduction processing on the training images, and obtain standard training images, where the training images include standard center point information, standard size information, and standard boundaries of the target object information;
  • the model building module 102 is used to build a target detection model
  • the target detection module 103 is configured to use the target detection model to perform target detection on the standard training image to obtain a detection result, where the detection result includes predicted center point information and predicted size information of the target And predict boundary information;
  • the loss function construction module 104 is configured to construct a target loss function according to the detection result and the standard training image
  • the model optimization module 105 is configured to calculate the loss value of the target loss function, and optimize the target detection model according to the loss value to obtain a standard target detection model;
  • the standard detection module 106 is configured to obtain an image of a target object to be detected, and use the standard target object detection model to perform image detection on the image of the target object to be detected to obtain a standard detection result.
  • each module of the device for detecting the target object in the image is as follows:
  • the image noise reduction module 101 is used to obtain training images, perform noise reduction processing on the training images, and obtain standard training images, where the training images include standard center point information, standard size information, and standard boundaries of the target object information.
  • a java sentence with a data capture function is used to obtain training images from a blockchain node for storing training images, and the high data throughput of the blockchain node can improve the efficiency of obtaining training images.
  • the training image is an image including a target object, and the training image also includes standard center point information, standard size information, and standard boundary information of the target object.
  • the training image is a histopathological image containing a target lesion
  • the histopathological image includes standard center point information of the target lesion, standard size information of the target lesion, and standard boundary information of the target lesion.
  • the image noise reduction module 101 is specifically used for:
  • the first value is 1, and the second value is 0.
  • the calculating the average value of pixels in the preset neighborhood of the target pixel point includes:
  • the following average value calculation formula is used to calculate the average value of pixels in the preset neighborhood:
  • f(j,k) is the pixel point (j,k) in the preset neighborhood
  • g(x,y) is the average value of the pixel
  • W is the preset neighborhood
  • j,k is the pixel in the preset neighborhood
  • med is the mean value processing operation
  • N is the number of pixels in the preset neighborhood.
  • the embodiment of the application performs noise reduction processing on the training image to obtain a standard training image, which can reduce noise in the training image, highlight the target in the training image, and improve the accuracy of the model trained using the standard training image.
  • the model construction module 102 is used to construct a target detection model.
  • the target detection model includes a plurality of parallel convolution channels with different resolutions.
  • the target detection model adopts the HRnet network structure, and the HRnet network uses multi-channel, multi-resolution branch parallel convolution to convolve the same feature, so as to obtain the same feature of the target with different resolutions.
  • the HRnet network used in the embodiments of the present application changes from a traditional serial connection convolution to a parallel connection convolution, thereby obtaining rich high-resolution representations and improving the accuracy of target detection by the model.
  • the target detection module 103 is configured to use the target detection model to perform target detection on the standard training image to obtain a detection result, where the detection result includes predicted center point information and predicted size information of the target And predict boundary information.
  • the target detection module 103 is specifically configured to:
  • Image segmentation is performed on the fusion feature map by using an image segmentation algorithm to obtain the detection result.
  • the image segmentation algorithm includes, but is not limited to, a region-based image segmentation algorithm, a threshold-based image segmentation algorithm, and an edge-based image segmentation algorithm.
  • the forward parallel convolution channel and the backward parallel convolution channel are relative terms.
  • the target detection model includes 4 parallel convolution channels, and the previous one is a parallel convolution that performs convolution on a standard training image.
  • the parallel convolution channel that convolves the standard training image is the forward parallel convolution channel; the latter parallel convolution channel that convolves the standard training image is relative to the previous one that convolves the standard training image.
  • the parallel convolution channel of is referred to as the backward parallel convolution channel.
  • the forward parallel convolution channel is the initial parallel convolution channel
  • the backward convolution convolves the result obtained in the forward direction and the input of the forward parallel convolution channel to obtain a feature map.
  • the backward convolution performs convolution on the result obtained in the forward direction and the input of all forward convolution channels to obtain a feature map.
  • the standard training image is convolved in the first parallel convolution channel to obtain the first feature map
  • the first parallel convolution channel, the first parallel convolution channel, the first parallel convolution channel, and the first parallel convolution channel are connected in parallel to obtain four feature maps of the same feature with different resolutions.
  • the resolution of the feature map obtained by the multi-layer parallel convolution channel output by the target detection model is gradually reduced, and the feature information is gradually enhanced. Therefore, the feature map obtained through the multi-layer parallel convolution channel in the embodiment of the present application contains both high-resolution position information and low-resolution feature information, which is more conducive to the subsequent use of feature maps for target detection and improves The accuracy of the target detection model.
  • the loss function construction module 104 is configured to construct a target loss function according to the detection result and the standard training image.
  • the target loss function includes: a center point loss function, a size loss function, and a boundary loss function.
  • the target loss function is:
  • L det is the center point loss function
  • L size is the size loss function
  • L bce is the boundary loss function
  • C is the number of target categories
  • H is the length of the standard training image
  • W is the standard training image
  • N is the number of the standard training images
  • ⁇ and ⁇ are preset constants
  • p cij is the prediction center point information
  • y cij is the standard center point information
  • s k is the prediction size information
  • p ij is prediction boundary information
  • y ij is standard boundary information.
  • the embodiment of the application uses a combination of a center point loss function, a size loss function, and a boundary loss function as the target loss function. At the same time, three loss values of the center point position, size, and boundary position of the target are used, and the three loss values are used to target the target. The parameters of the object detection model are updated, which is beneficial to improve the accuracy of the target object detection model.
  • the model optimization module 105 is configured to calculate the loss value of the target loss function, and optimize the target detection model according to the loss value to obtain a standard target detection model.
  • the model optimization module 105 is specifically used for:
  • an optimization algorithm is used to optimize the parameters of the target detection model
  • the Adam optimization algorithm when the loss value of the target loss function is greater than the preset loss threshold, the Adam optimization algorithm is used to optimize the parameters of the target detection model.
  • the Adam optimization algorithm can adaptively adjust the target detection model training process
  • the learning rate makes the target detection model more accurate and improves the performance of the target detection model.
  • the standard detection module 106 is configured to obtain an image of a target object to be detected, and use the standard target object detection model to perform image detection on the image of the target object to be detected to obtain a standard detection result.
  • the image of the target object to be detected includes a medical image of a biological tissue.
  • the image of the lesion to be detected can be uploaded by the user through a user-side program.
  • the image of the lesion to be detected is obtained, the image of the lesion to be detected is input to the standard lesion detection model for lesion detection, and the standard detection result is obtained.
  • the embodiment of the application improves the quality of the training image by denoising the training image, and further improves the accuracy of the target detection model trained by the training image; the target detection model is calculated separately by constructing the target loss function to output the target.
  • the three loss values of predicted center point information, predicted size information and predicted boundary information are used to update the parameters of the target detection model by using the three loss values to improve the size, size and position of the target output by the target detection model.
  • the accuracy of the target object to be detected is acquired, and the standard target object detection model is used to perform image detection on the image of the target object to be detected, without manual image analysis, which improves the detection efficiency of the target object in the image. Therefore, the device for detecting a target in an image proposed in this application can improve the efficiency and accuracy of detecting the target in the image.
  • FIG. 5 it is a schematic structural diagram of an electronic device that implements the method for detecting a target object in an image according to the present application.
  • the electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a target detection program 12 in an image.
  • the memory 11 includes at least one type of readable storage medium, and the memory 11 may be volatile or non-volatile.
  • the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various data installed in the electronic device 1, such as the code of the target detection program 12 in the image, etc., but also to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc.
  • the processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules stored in the memory 11 (such as executing The detection program of the target in the image, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 5 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 5 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
  • the electronic device 1 may also include a power source (such as a battery) for supplying power to various components.
  • the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling power
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators.
  • the electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface.
  • the network interface may include a wired interface and/or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may also include a user interface.
  • the user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)).
  • the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
  • the detection program 12 of the target object in the image stored in the memory 11 in the electronic device 1 is a combination of multiple computer programs. When running in the processor 10, it can realize:
  • the target detection model Performing target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes predicted center point information, predicted size information, and predicted boundary information of the target;
  • An image of the target to be detected is acquired, and the standard target detection model is used to perform image detection on the image of the target to be detected to obtain a standard detection result.
  • the integrated module/unit of the electronic device 1 can be stored in a computer-readable storage medium. It can be volatile or non-volatile.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
  • the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store a block chain node Use the created data, etc.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.
  • the blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

A method and apparatus for detecting a target object in an image, and an electronic device and a storage medium, which relate to image analysis technology. The method comprises: performing noise reduction processing on a training image so as to obtain a standard training image, and performing target object detection on the standard training image using a target object detection model so as to obtain predicted centre point information, predicted size information and predicted boundary information; constructing a target loss function, calculating a loss value, and optimizing the target object detection model according to the loss value so as to obtain a standard target object detection model; and acquiring a target object image to be subjected to detection, and performing image detection on said target object image using the standard target object detection model so as to obtain a standard detection result. In addition, the method further relates to blockchain technology, and the standard detection result can be stored in a blockchain node. The method can be applied to the detection of lesion information in a medical image. By means of the method, the efficiency and accuracy of detecting a target object in an image can be improved.

Description

图像中目标物的检测方法、装置、电子设备及存储介质Detection method, device, electronic equipment and storage medium of target in image
本申请要求于2020年09月25日提交中国专利局、申请号为CN202011023942.3、名称为“图像中目标物的检测方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on September 25, 2020, with the application number CN202011023942.3, titled "Methods, devices, electronic equipment and storage media for detecting objects in images", which The entire content is incorporated into this application by reference.
技术领域Technical field
本申请涉及图像分析技术领域,尤其涉及一种图像中目标物的检测方法、装置、电子设备及计算机可读存储介质。This application relates to the field of image analysis technology, and in particular to a method, device, electronic equipment, and computer-readable storage medium for detecting a target in an image.
背景技术Background technique
医学领域中,医生对医疗图像进行观测、分析,进而从医疗图像中检测出病灶的信息是一种常见的医疗手段,极大的帮助了医生对病人病情的了解与分析。例如,对病人的组织图像进行分析,可尽早地发现组织中的病灶。In the medical field, it is a common medical method for doctors to observe and analyze medical images, and then to detect lesion information from the medical images, which greatly helps doctors understand and analyze the patient's condition. For example, by analyzing the image of the patient's tissue, the lesions in the tissue can be found as early as possible.
目前对于医疗图像中病灶的检出,大多数情况下还是依靠医生人工进行。发明人意识到,该方法过于依赖医生的经验,导致对于较难观测到的病灶会出现漏检的情况;且人工检测效率低下,也无法获取病灶的大小、尺寸及位置的精确信息,影响检测的准确度,不利于后续对病情进行分析。At present, the detection of lesions in medical images is still performed manually by doctors in most cases. The inventor realized that this method relies too much on the doctor’s experience, leading to missed detection of lesions that are more difficult to observe; and the manual detection efficiency is low, and accurate information on the size, size and location of the lesion cannot be obtained, which affects the detection. The accuracy is not conducive to subsequent analysis of the condition.
发明内容Summary of the invention
本申请提供的一种图像中目标物的检测方法,包括:A method for detecting a target in an image provided by this application includes:
获取训练图像,对所述训练图像进行降噪处理,得到标准训练图像,其中,所述训练图像包括目标物的标准中心点信息、标准尺寸信息及标准边界信息;Acquiring a training image, performing noise reduction processing on the training image to obtain a standard training image, wherein the training image includes standard center point information, standard size information, and standard boundary information of the target object;
构建目标物检测模型;Build a target detection model;
利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,其中,所述检测结果包括目标物的预测中心点信息、预测尺寸信息及预测边界信息;Performing target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes predicted center point information, predicted size information, and predicted boundary information of the target;
根据所述检测结果和所述标准训练图像构建目标损失函数;Constructing a target loss function according to the detection result and the standard training image;
计算所述目标损失函数的损失值,根据所述损失值对所述目标物检测模型进行优化,得到标准目标物检测模型;Calculating the loss value of the target loss function, and optimizing the target detection model according to the loss value to obtain a standard target detection model;
获取待检测目标物图像,利用所述标准目标物检测模型对所述待检测目标物图像进行图像检测,得到标准检测结果。An image of the target to be detected is acquired, and the standard target detection model is used to perform image detection on the image of the target to be detected to obtain a standard detection result.
本申请还提供一种图像中目标物的检测装置,所述装置包括:The present application also provides a device for detecting a target in an image, the device including:
图像降噪模块,用于获取训练图像,对所述训练图像进行降噪处理,得到标准训练图像,其中,所述训练图像包括目标物的标准中心点信息、标准尺寸信息及标准边界信息;The image noise reduction module is used to obtain training images, perform noise reduction processing on the training images to obtain standard training images, wherein the training images include standard center point information, standard size information, and standard boundary information of the target;
模型构建模块,用于构建目标物检测模型;Model building module, used to build a target detection model;
目标物检测模块,用于利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,其中,所述检测结果包括目标物的预测中心点信息、预测尺寸信息及预测边界信息;The target detection module is used to perform target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes the predicted center point information, predicted size information, and predicted boundary of the target information;
损失函数构建模块,用于根据所述检测结果和所述标准训练图像构建目标损失函数;A loss function construction module, configured to construct a target loss function according to the detection result and the standard training image;
模型优化模块,用于计算所述目标损失函数的损失值,根据所述损失值对所述目标物检测模型进行优化,得到标准目标物检测模型;A model optimization module is used to calculate the loss value of the target loss function, and optimize the target detection model according to the loss value to obtain a standard target detection model;
标准检测模块,用于获取待检测目标物图像,利用所述标准目标物检测模型对所述待检测目标物图像进行图像检测,得到标准检测结果。The standard detection module is used to obtain an image of a target object to be detected, and use the standard target object detection model to perform image detection on the image of the target object to be detected to obtain a standard detection result.
本申请还提供一种电子设备,所述电子设备包括:This application also provides an electronic device, which includes:
至少一个处理器;以及,At least one processor; and,
与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute the following steps:
获取训练图像,对所述训练图像进行降噪处理,得到标准训练图像,其中,所述训练图像包括目标物的标准中心点信息、标准尺寸信息及标准边界信息;Acquiring a training image, performing noise reduction processing on the training image to obtain a standard training image, wherein the training image includes standard center point information, standard size information, and standard boundary information of the target object;
构建目标物检测模型;Build a target detection model;
利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,其中,所述检测结果包括目标物的预测中心点信息、预测尺寸信息及预测边界信息;Performing target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes predicted center point information, predicted size information, and predicted boundary information of the target;
根据所述检测结果和所述标准训练图像构建目标损失函数;Constructing a target loss function according to the detection result and the standard training image;
计算所述目标损失函数的损失值,根据所述损失值对所述目标物检测模型进行优化,得到标准目标物检测模型;Calculating the loss value of the target loss function, and optimizing the target detection model according to the loss value to obtain a standard target detection model;
获取待检测目标物图像,利用所述标准目标物检测模型对所述待检测目标物图像进行图像检测,得到标准检测结果。An image of the target to be detected is acquired, and the standard target detection model is used to perform image detection on the image of the target to be detected to obtain a standard detection result.
为了解决上述问题,本申请还提供一种计算机可读存储介质,包括存储数据区和存储程序区,其中,所述存储数据区存储创建的数据,所述存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现如下步骤:In order to solve the above-mentioned problems, the present application also provides a computer-readable storage medium, including a storage data area and a storage program area, wherein the storage data area stores created data, and the storage program area stores a computer program; wherein, When the computer program is executed by the processor, the following steps are implemented:
获取训练图像,对所述训练图像进行降噪处理,得到标准训练图像,其中,所述训练图像包括目标物的标准中心点信息、标准尺寸信息及标准边界信息;Acquiring a training image, performing noise reduction processing on the training image to obtain a standard training image, wherein the training image includes standard center point information, standard size information, and standard boundary information of the target object;
构建目标物检测模型;Build a target detection model;
利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,其中,所述检测结果包括目标物的预测中心点信息、预测尺寸信息及预测边界信息;Performing target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes predicted center point information, predicted size information, and predicted boundary information of the target;
根据所述检测结果和所述标准训练图像构建目标损失函数;Constructing a target loss function according to the detection result and the standard training image;
计算所述目标损失函数的损失值,根据所述损失值对所述目标物检测模型进行优化,得到标准目标物检测模型;Calculating the loss value of the target loss function, and optimizing the target detection model according to the loss value to obtain a standard target detection model;
获取待检测目标物图像,利用所述标准目标物检测模型对所述待检测目标物图像进行图像检测,得到标准检测结果。An image of the target to be detected is acquired, and the standard target detection model is used to perform image detection on the image of the target to be detected to obtain a standard detection result.
附图说明Description of the drawings
图1为本申请一实施例提供的图像中目标物的检测方法的流程示意图;FIG. 1 is a schematic flowchart of a method for detecting a target in an image provided by an embodiment of the application;
图2为本申请一实施例提供的对训练图像进行降噪处理的流程示意图;FIG. 2 is a schematic diagram of a flow of noise reduction processing on training images provided by an embodiment of the application;
图3为本申请一实施例提供的利用目标物检测模型对标准训练图像进行目标物检测的流程示意图;FIG. 3 is a schematic diagram of a process of using a target detection model to perform target detection on a standard training image according to an embodiment of the application;
图4为本申请一实施例提供的图像中目标物的检测装置的模块示意图;4 is a schematic diagram of modules of a detection device for a target in an image provided by an embodiment of the application;
图5为本申请一实施例提供的实现图像中目标物的检测方法的电子设备的内部结构示意图;5 is a schematic diagram of the internal structure of an electronic device that implements a method for detecting a target object in an image provided by an embodiment of the application;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.
本申请实施例提供的图像中目标物的检测方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述图像中目标物的检测方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。The execution subject of the method for detecting a target in an image provided by the embodiment of the application includes but is not limited to at least one of the electronic devices that can be configured to execute the method provided by the embodiment of the application, such as a server and a terminal. In other words, the detection method of the target in the image can be executed by software or hardware installed in the terminal device or the server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
本申请提供一种图像中目标物的检测方法。参照图1所示,为本申请一实施例提供的图像中目标物的检测方法的流程示意图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。This application provides a method for detecting a target in an image. Referring to FIG. 1, it is a schematic flowchart of a method for detecting a target in an image provided by an embodiment of this application. The method can be executed by a device, and the device can be implemented by software and/or hardware.
在本实施例中,图像中目标物的检测方法包括:In this embodiment, the method for detecting the target in the image includes:
S1、获取训练图像,对所述训练图像进行降噪处理,得到标准训练图像,其中,所述训练图像包括目标物的标准中心点信息、标准尺寸信息及标准边界信息。S1. Obtain a training image, perform noise reduction processing on the training image to obtain a standard training image, where the training image includes standard center point information, standard size information, and standard boundary information of the target object.
本申请实施例中,利用具有数据抓取功能的java语句从用于存储训练图像的区块链节点中获取训练图像,利用区块链节点的高数据吞吐性,可提高获取训练图像的效率。In the embodiments of the present application, a java sentence with a data capture function is used to obtain training images from a blockchain node for storing training images, and the high data throughput of the blockchain node can improve the efficiency of obtaining training images.
具体地,所述训练图像为包括目标物的图像,所述训练图像还包括目标物的标准中心点信息、标准尺寸信息及标准边界信息。Specifically, the training image is an image including a target object, and the training image also includes standard center point information, standard size information, and standard boundary information of the target object.
例如,训练图像为包含目标病灶的组织病理图像,组织病理图像中包括了目标病灶的标准中心点信息、目标病灶的标准尺寸信息及目标病灶的标准边界信息。For example, the training image is a histopathological image containing a target lesion, and the histopathological image includes standard center point information of the target lesion, standard size information of the target lesion, and standard boundary information of the target lesion.
图2为本申请一实施例提供的对训练图像进行降噪处理的流程示意图;FIG. 2 is a schematic diagram of a flow of noise reduction processing on training images provided by an embodiment of the application;
详细地,参图2所示,所述对所述训练图像进行降噪处理,得到标准训练图像,包括:In detail, as shown in FIG. 2, the denoising processing on the training image to obtain a standard training image includes:
S10、计算所述训练图像中所有像素点的像素均值;S10. Calculate the pixel average of all pixels in the training image;
S11、将所述训练图像中所有大于或等于所述像素均值的像素点的像素值置为第一数值,将所述训练图像中所有大于或等于所述像素均值的像素点的像素值置为第二数值,得到归一化图像;S11. Set the pixel values of all pixels greater than or equal to the pixel average value in the training image to a first value, and set the pixel values of all pixels greater than or equal to the pixel average value in the training image to The second value, the normalized image is obtained;
S12、随机获取所述归一化图像中目标像素点,计算所述目标像素点的预设邻域内的像素均值;S12. Randomly obtain a target pixel in the normalized image, and calculate an average value of pixels in a preset neighborhood of the target pixel;
S13、将所述目标像素点的像素值利用所述像素均值进行替换,得到均值图像;S13. Replace the pixel value of the target pixel with the pixel average value to obtain an average value image;
S14、删除所述均值图像中所有像素值为第二数值的像素点,得到标准训练图像。S14. Delete all pixels with the second value in the average image to obtain a standard training image.
优选的,所述第一数值为1,所述第二数值为0.Preferably, the first value is 1, and the second value is 0.
具体地,所述计算所述目标像素点的预设邻域内的像素均值,包括:Specifically, the calculating the average value of pixels in the preset neighborhood of the target pixel point includes:
利用如下均值计算公式计算所述预设邻域内的像素均值:The following average value calculation formula is used to calculate the average value of pixels in the preset neighborhood:
Figure PCTCN2020131992-appb-000001
Figure PCTCN2020131992-appb-000001
其中,f(j,k)为预设邻域内的像素点(j,k);g(x,y)为所述像素均值,W为预设邻域;j,k为预设邻域内像素点的坐标;med为均值处理运算,N为预设邻域内像素点的数量。Where f(j,k) is the pixel point (j,k) in the preset neighborhood; g(x,y) is the average value of the pixel, W is the preset neighborhood; j,k is the pixel in the preset neighborhood The coordinates of the point; med is the mean value processing operation, and N is the number of pixels in the preset neighborhood.
本申请实施例对所述训练图像进行降噪处理,得到标准训练图像,可减少训练图像中的噪点,突出训练图像中目标物,提高利用标准训练图像训练得到的模型的精确度。The embodiment of the application performs noise reduction processing on the training image to obtain a standard training image, which can reduce noise in the training image, highlight the target in the training image, and improve the accuracy of the model trained using the standard training image.
S2、构建目标物检测模型。S2. Construct a target detection model.
详细地,所述目标物检测模型包括多个不同分辨率的并行卷积通道。In detail, the target detection model includes a plurality of parallel convolution channels with different resolutions.
本申请实施例中,所述目标物检测模型采用HRnet网络结构,所述HRnet网络采用多通道、多分辨率分支并行卷积的方式对同一特征进行卷积,从而得到目标物同一特征不同分辨率下的特征图。In the embodiment of the application, the target detection model adopts the HRnet network structure, and the HRnet network uses multi-channel, multi-resolution branch parallel convolution to convolve the same feature, so as to obtain the same feature of the target with different resolutions. Feature map under.
本申请实施例采用的HRnet网络,由传统的串行连接卷积,改成并行连接卷积,进而得到丰富的高分辨率表征,提高了模型进行目标检测的精确度。The HRnet network used in the embodiments of the present application changes from a traditional serial connection convolution to a parallel connection convolution, thereby obtaining rich high-resolution representations and improving the accuracy of target detection by the model.
S3、利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,其中,所述检测结果包括目标物的预测中心点信息、预测尺寸信息及预测边界信息。S3. Perform target detection on the standard training image by using the target detection model to obtain a detection result, where the detection result includes predicted center point information, predicted size information, and predicted boundary information of the target.
图3为本申请一实施例提供的利用目标物检测模型对标准训练图像进行目标物检测的流程示意图。FIG. 3 is a schematic diagram of a process of using a target detection model to perform target detection on a standard training image according to an embodiment of the application.
本申请实施例中,参图3所示,所述利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,包括:In the embodiment of the present application, as shown in FIG. 3, the use of the target detection model to perform target detection on the standard training image to obtain a detection result includes:
S30、获取在前向并行卷积通道中基于所述标准训练图像集进行卷积得到的前向特征图;S30. Obtain a forward feature map obtained by convolution based on the standard training image set in a forward parallel convolution channel;
S31、在后向并行卷积通道中对所述前向特征图及所述前向特征图的下采样图像进行卷积,获得后向特征图;S31. Convolve the forward feature map and the down-sampled image of the forward feature map in a backward parallel convolution channel to obtain a backward feature map;
S32、对获得的前向特征图和后向特征图进行特征融合,得到融合特征图;S32: Perform feature fusion on the obtained forward feature map and backward feature map to obtain a fused feature map;
S33、利用图像分割算法对所述融合特征图进行图像分割,得到所述检测结果。S33. Perform image segmentation on the fusion feature map by using an image segmentation algorithm to obtain the detection result.
详细地,所述图像分割算法包括但不限于基于区域的图像分割算法、基于阈值的图像分割算法、基于边缘的图像分割算法。In detail, the image segmentation algorithm includes, but is not limited to, a region-based image segmentation algorithm, a threshold-based image segmentation algorithm, and an edge-based image segmentation algorithm.
所述前向并行卷积通道与所述后向并行卷积通道是相对而言的,例如,目标物检测模型包括4个并行卷积通道,前一个对标准训练图像进行卷积的并行卷积通道相对于后一个对标准训练图像进行卷积的并行卷积通道为前向并行卷积通道;后一个对标准训练图像进行卷积的并行卷积通道相对于前一个对标准训练图像进行卷积的并行卷积通道来说为后向并行卷积通道。The forward parallel convolution channel and the backward parallel convolution channel are relative terms. For example, the target detection model includes 4 parallel convolution channels, and the previous one is a parallel convolution that performs convolution on a standard training image. Compared with the latter, the parallel convolution channel that convolves the standard training image is the forward parallel convolution channel; the latter parallel convolution channel that convolves the standard training image is relative to the previous one that convolves the standard training image. The parallel convolution channel of is referred to as the backward parallel convolution channel.
当前向并行卷积通道为初始并行卷积通道时,后向卷积的对前向得到的结果及前向并行卷积通道的输入进行卷积,得到特征图。When the forward parallel convolution channel is the initial parallel convolution channel, the backward convolution convolves the result obtained in the forward direction and the input of the forward parallel convolution channel to obtain a feature map.
当前向并行卷积通道不为初始卷积通道时,后向卷积的对前向得到的结果及所有前向卷积通道的输入进行卷积,得到特征图。When the forward parallel convolution channel is not the initial convolution channel, the backward convolution performs convolution on the result obtained in the forward direction and the input of all forward convolution channels to obtain a feature map.
具体地,例如,在第一并行卷积通道中对所述标准训练图像进行卷积,得到第一特征图;Specifically, for example, the standard training image is convolved in the first parallel convolution channel to obtain the first feature map;
在第二并行卷积通道中对所述第一特征图及所述第一特征图的第一下采样图像进行卷积,得到第二特征图;Convolve the first feature map and the first down-sampled image of the first feature map in a second parallel convolution channel to obtain a second feature map;
在第三并行卷积通道中对所述第二特征图及所述第二特征图的第二下采样图像进行卷积,得到第三特征图;Convolve the second feature map and the second down-sampled image of the second feature map in a third parallel convolution channel to obtain a third feature map;
在第四并行卷积通道中对所述第三特征图及所述第三特征图的第三下采样图像进行卷积,得到第四特征图;Convolve the third feature map and the third down-sampled image of the third feature map in a fourth parallel convolution channel to obtain a fourth feature map;
对所述第一特征图、所述第二特征图、所述第三特征图和所述第四特征图进行特征融合得到融合特征图,并利用图像分割算法对所述融合特征图进行图像分割,得到所述检测结果。Perform feature fusion on the first feature map, the second feature map, the third feature map, and the fourth feature map to obtain a fused feature map, and use an image segmentation algorithm to perform image segmentation on the fused feature map , Get the test result.
其中,第一并行卷积通道、第一并行卷积通道、第一并行卷积通道、第一并行卷积通道以并行方式连接,以此得到同一特征的四种不同分辨率的特征图。Among them, the first parallel convolution channel, the first parallel convolution channel, the first parallel convolution channel, and the first parallel convolution channel are connected in parallel to obtain four feature maps of the same feature with different resolutions.
由于高分辨率图像含有更多的像素位置信息,更有利于位置信息的提取,低分辨率图像含有更多的特征信息,更有利于特征的识别。因此,本申请实施例中,所述目标物检测模型输出多层并行卷积通道得到的特征图的分辨率逐渐降低,特征信息也逐渐增强。所以,本申请实施例通过多层并行卷积通道得到的特征图即包含了高分辨率的位置信息,又包含了低分辨率的特征信息,更有利于后续利用特征图进行目标物检测,提高目标物检测模型的精确度。Because high-resolution images contain more pixel location information, it is more conducive to the extraction of location information, and low-resolution images contain more feature information, which is more conducive to feature recognition. Therefore, in the embodiment of the present application, the resolution of the feature map obtained by the multi-layer parallel convolution channel output by the target detection model is gradually reduced, and the feature information is gradually enhanced. Therefore, the feature map obtained through the multi-layer parallel convolution channel in the embodiment of the present application contains both high-resolution position information and low-resolution feature information, which is more conducive to the subsequent use of the feature map for target detection and improves The accuracy of the target detection model.
S4、根据所述检测结果和所述标准训练图像构建目标损失函数。S4. Construct a target loss function according to the detection result and the standard training image.
本申请实施例中,所述目标损失函数包括:中心点损失函数、尺寸损失函数及边界损失函数。In the embodiment of the present application, the target loss function includes: a center point loss function, a size loss function, and a boundary loss function.
详细地,所述目标损失函数为:In detail, the target loss function is:
Loss=L det+0.1×L size+L bce Loss=L det +0.1×L size +L bce
Figure PCTCN2020131992-appb-000002
Figure PCTCN2020131992-appb-000002
Figure PCTCN2020131992-appb-000003
Figure PCTCN2020131992-appb-000003
Figure PCTCN2020131992-appb-000004
Figure PCTCN2020131992-appb-000004
其中,L det为中心点损失函数,L size为尺寸损失函数,L bce为边界损失函数,C为目标物的类别的数量,H为所述标准训练图像的长度,W为所述标准训练图像的宽度,N为所述标准训练图像的数量,α、β为预设常数,p cij为预测中心点信息,y cij为标准中心点信息,s k为预测尺寸信息,
Figure PCTCN2020131992-appb-000005
为标准尺寸信息,p ij为预测边界信息,y ij为标准边界信息。
Where L det is the center point loss function, L size is the size loss function, L bce is the boundary loss function, C is the number of target categories, H is the length of the standard training image, and W is the standard training image , N is the number of the standard training images, α and β are preset constants, p cij is the prediction center point information, y cij is the standard center point information, and s k is the prediction size information,
Figure PCTCN2020131992-appb-000005
Is standard size information, p ij is prediction boundary information, and y ij is standard boundary information.
详细地,在计算中心点损失函数的函数值时,若所述预测中心点信息与所述标准中心点信息一致(即,if y cij=1),则L det为: In detail, when calculating the function value of the center point loss function, if the predicted center point information is consistent with the standard center point information (that is, if y cij =1), then L det is:
Figure PCTCN2020131992-appb-000006
Figure PCTCN2020131992-appb-000006
若所述预测中心点信息与所述标准中心点信息不一致(即otherwise),则L det为: If the predicted center point information is inconsistent with the standard center point information (that is, otherwise), then L det is:
Figure PCTCN2020131992-appb-000007
Figure PCTCN2020131992-appb-000007
本申请实施例利用中心点损失函数、尺寸损失函数及边界损失函数组合为目标损失函数,同时利用目标物的中心点位置,尺寸大小及边界位置的三种损失值,利用三种损失值对目标物检测模型的参数进行更新,有利于提高目标物检测模型的精度。The embodiment of the application uses a combination of a center point loss function, a size loss function, and a boundary loss function as the target loss function. At the same time, three loss values of the center point position, size, and boundary position of the target are used, and the three loss values are used to target the target. The parameters of the object detection model are updated, which is beneficial to improve the accuracy of the target object detection model.
S5、计算所述目标损失函数的损失值,根据所述损失值对所述目标物检测模型进行优化,得到标准目标物检测模型。S5. Calculate the loss value of the target loss function, and optimize the target detection model according to the loss value to obtain a standard target detection model.
本申请实施例根据所述损失值对所述目标物检测模型进行优化,包括:The embodiment of the application optimizing the target detection model according to the loss value includes:
当所述目标损失函数的损失值大于预设的损失阈值,则利用优化算法对所述目标物检测模型的参数进行优化;When the loss value of the target loss function is greater than the preset loss threshold, an optimization algorithm is used to optimize the parameters of the target detection model;
当所述目标损失函数的损失值小于或等于所述损失阈值,得到标准目标物检测模型。When the loss value of the target loss function is less than or equal to the loss threshold, a standard target detection model is obtained.
本申请实施例中,当所述目标损失函数的损失值大于预设的损失阈值,使用Adam优化算法对目标物检测模型的参数进行优化,Adam优化算法可自适应调节目标物检测模型训练过程中的学习率,使得目标物检测模型更加精确,提升目标物检测模型的性能。In the embodiment of this application, when the loss value of the target loss function is greater than the preset loss threshold, the Adam optimization algorithm is used to optimize the parameters of the target detection model. The Adam optimization algorithm can adaptively adjust the target detection model training process The learning rate makes the target detection model more accurate and improves the performance of the target detection model.
S6、获取待检测目标物图像,利用所述标准目标物检测模型对所述待检测目标物图像进行图像检测,得到标准检测结果。S6. Obtain an image of the target object to be detected, and perform image detection on the target object image to be detected using the standard target object detection model to obtain a standard detection result.
本申请实施例中,所述待检测目标物图像包括生物体组织的医学图像。所述待检测病灶图像可由用户通过用户端程序进行上传,当获取到待检测病灶图像后,将所述待检测病灶图像输入至标准病灶检测模型进行病灶检测,得到标准检测结果。In the embodiment of the present application, the image of the target object to be detected includes a medical image of a biological tissue. The image of the lesion to be detected can be uploaded by the user through a user-side program. When the image of the lesion to be detected is obtained, the image of the lesion to be detected is input to a standard lesion detection model for lesion detection, and a standard detection result is obtained.
本申请实施例通过对训练图像进行降噪处理,提高训练图像的质量,进而提高利用训练图像训练得到的目标物检测模型的精确性;通过构建目标损失函数分别计算目标物检测模型对目标物输出的预测中心点信息、预测尺寸信息及预测边界信息的三种损失值,利用三种损失值对目标物检测模型的参数进行更新,提高了目标物检测模型输出的目标物的大小、尺寸及位置的精确性;获取待检测目标物图像,利用标准目标物检测模型对待检测目标物图像进行图像检测,无需人工进行图像分析,提高了图像中目标物的检测效率。因此本申请提出的图像中目标物的检测方法,可以提高图像中目标物的检测的效率及准确度。The embodiment of the application improves the quality of the training image by denoising the training image, and further improves the accuracy of the target detection model trained by the training image; the target detection model is calculated separately by constructing the target loss function to output the target. The three loss values of predicted center point information, predicted size information and predicted boundary information are used to update the parameters of the target detection model by using the three loss values to improve the size, size and position of the target output by the target detection model The accuracy of the target object to be detected is acquired, and the standard target object detection model is used to perform image detection on the image of the target object to be detected, without manual image analysis, which improves the detection efficiency of the target object in the image. Therefore, the method for detecting a target in an image proposed in this application can improve the efficiency and accuracy of detecting the target in the image.
如图4所示,是本申请图像中目标物的检测装置的模块示意图。As shown in FIG. 4, it is a schematic diagram of the module of the detection device for the target in the image of the present application.
本申请所述图像中目标物的检测装置100可以安装于电子设备中。根据实现的功能,所述图像中目标物的检测装置可以包括所述图像降噪模块101、模型构建模块102、目标 物检测模块103、损失函数构建模块104、模型优化模块105和标准检测模块106。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The device 100 for detecting a target in an image described in this application can be installed in an electronic device. According to the realized function, the detection device of the target in the image may include the image noise reduction module 101, the model construction module 102, the target detection module 103, the loss function construction module 104, the model optimization module 105, and the standard detection module 106. . The module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述图像降噪模块101,用于获取训练图像,对所述训练图像进行降噪处理,得到标准训练图像,其中,所述训练图像包括目标物的标准中心点信息、标准尺寸信息及标准边界信息;The image noise reduction module 101 is used to obtain training images, perform noise reduction processing on the training images, and obtain standard training images, where the training images include standard center point information, standard size information, and standard boundaries of the target object information;
所述模型构建模块102,用于构建目标物检测模型;The model building module 102 is used to build a target detection model;
所述目标物检测模块103,用于利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,其中,所述检测结果包括目标物的预测中心点信息、预测尺寸信息及预测边界信息;The target detection module 103 is configured to use the target detection model to perform target detection on the standard training image to obtain a detection result, where the detection result includes predicted center point information and predicted size information of the target And predict boundary information;
所述损失函数构建模块104,用于根据所述检测结果和所述标准训练图像构建目标损失函数;The loss function construction module 104 is configured to construct a target loss function according to the detection result and the standard training image;
所述模型优化模块105,用于计算所述目标损失函数的损失值,根据所述损失值对所述目标物检测模型进行优化,得到标准目标物检测模型;The model optimization module 105 is configured to calculate the loss value of the target loss function, and optimize the target detection model according to the loss value to obtain a standard target detection model;
所述标准检测模块106,用于获取待检测目标物图像,利用所述标准目标物检测模型对所述待检测目标物图像进行图像检测,得到标准检测结果。The standard detection module 106 is configured to obtain an image of a target object to be detected, and use the standard target object detection model to perform image detection on the image of the target object to be detected to obtain a standard detection result.
详细地,所述图像中目标物的检测装置各模块的具体实施方式如下:In detail, the specific implementation of each module of the device for detecting the target object in the image is as follows:
所述图像降噪模块101,用于获取训练图像,对所述训练图像进行降噪处理,得到标准训练图像,其中,所述训练图像包括目标物的标准中心点信息、标准尺寸信息及标准边界信息。The image noise reduction module 101 is used to obtain training images, perform noise reduction processing on the training images, and obtain standard training images, where the training images include standard center point information, standard size information, and standard boundaries of the target object information.
本申请实施例中,利用具有数据抓取功能的java语句从用于存储训练图像的区块链节点中获取训练图像,利用区块链节点的高数据吞吐性,可提高获取训练图像的效率。In the embodiments of the present application, a java sentence with a data capture function is used to obtain training images from a blockchain node for storing training images, and the high data throughput of the blockchain node can improve the efficiency of obtaining training images.
具体地,所述训练图像为包括目标物的图像,所述训练图像还包括目标物的标准中心点信息、标准尺寸信息及标准边界信息。Specifically, the training image is an image including a target object, and the training image also includes standard center point information, standard size information, and standard boundary information of the target object.
例如,训练图像为包含目标病灶的组织病理图像,组织病理图像中包括了目标病灶的标准中心点信息、目标病灶的标准尺寸信息及目标病灶的标准边界信息。For example, the training image is a histopathological image containing a target lesion, and the histopathological image includes standard center point information of the target lesion, standard size information of the target lesion, and standard boundary information of the target lesion.
详细地,所述图像降噪模块101具体用于:In detail, the image noise reduction module 101 is specifically used for:
计算所述训练图像中所有像素点的像素均值;Calculating the pixel mean value of all pixels in the training image;
将所述训练图像中所有大于或等于所述像素均值的像素点的像素值置为第一数值,将所述训练图像中所有大于或等于所述像素均值的像素点的像素值置为第二数值,得到归一化图像;Set the pixel values of all pixels in the training image that are greater than or equal to the pixel average value to a first value, and set the pixel values of all pixels that are greater than or equal to the pixel average value in the training image to a second value Numerical value to get the normalized image;
随机获取所述归一化图像中目标像素点,计算所述目标像素点的预设邻域内的像素均值;Randomly acquiring a target pixel in the normalized image, and calculating an average value of pixels in a preset neighborhood of the target pixel;
将所述目标像素点的像素值利用所述像素均值进行替换,得到均值图像;Replacing the pixel value of the target pixel with the pixel average value to obtain an average value image;
删除所述均值图像中所有像素值为第二数值的像素点,得到标准训练图像。Delete all the pixels with the second value in the average image to obtain a standard training image.
优选的,所述第一数值为1,所述第二数值为0.Preferably, the first value is 1, and the second value is 0.
具体地,所述计算所述目标像素点的预设邻域内的像素均值,包括:Specifically, the calculating the average value of pixels in the preset neighborhood of the target pixel point includes:
利用如下均值计算公式计算所述预设邻域内的像素均值:The following average value calculation formula is used to calculate the average value of pixels in the preset neighborhood:
Figure PCTCN2020131992-appb-000008
Figure PCTCN2020131992-appb-000008
其中,f(j,k)为预设邻域内的像素点(j,k);g(x,y)为所述像素均值,W为预设邻域;j,k为预设邻域内像素点的坐标;med为均值处理运算,N为预设邻域内像素点的数量。Where f(j,k) is the pixel point (j,k) in the preset neighborhood; g(x,y) is the average value of the pixel, W is the preset neighborhood; j,k is the pixel in the preset neighborhood The coordinates of the point; med is the mean value processing operation, and N is the number of pixels in the preset neighborhood.
本申请实施例对所述训练图像进行降噪处理,得到标准训练图像,可减少训练图像中 的噪点,突出训练图像中目标物,提高利用标准训练图像训练得到的模型的精确度。The embodiment of the application performs noise reduction processing on the training image to obtain a standard training image, which can reduce noise in the training image, highlight the target in the training image, and improve the accuracy of the model trained using the standard training image.
所述模型构建模块102,用于构建目标物检测模型。The model construction module 102 is used to construct a target detection model.
详细地,所述目标物检测模型包括多个不同分辨率的并行卷积通道。In detail, the target detection model includes a plurality of parallel convolution channels with different resolutions.
本申请实施例中,所述目标物检测模型采用HRnet网络结构,所述HRnet网络采用多通道、多分辨率分支并行卷积的方式对同一特征进行卷积,从而得到目标物同一特征不同分辨率下的特征图。In the embodiment of the application, the target detection model adopts the HRnet network structure, and the HRnet network uses multi-channel, multi-resolution branch parallel convolution to convolve the same feature, so as to obtain the same feature of the target with different resolutions. Feature map under.
本申请实施例采用的HRnet网络,由传统的串行连接卷积,改成并行连接卷积,进而得到丰富的高分辨率表征,提高了模型进行目标检测的精确度。The HRnet network used in the embodiments of the present application changes from a traditional serial connection convolution to a parallel connection convolution, thereby obtaining rich high-resolution representations and improving the accuracy of target detection by the model.
所述目标物检测模块103,用于利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,其中,所述检测结果包括目标物的预测中心点信息、预测尺寸信息及预测边界信息。The target detection module 103 is configured to use the target detection model to perform target detection on the standard training image to obtain a detection result, where the detection result includes predicted center point information and predicted size information of the target And predict boundary information.
本申请实施例中,所述目标物检测模块103具体用于:In the embodiment of the present application, the target detection module 103 is specifically configured to:
获取在前向并行卷积通道中基于所述标准训练图像集进行卷积得到的前向特征图;Acquiring a forward feature map obtained by convolution based on the standard training image set in a forward parallel convolution channel;
在后向并行卷积通道中对所述前向特征图及所述前向特征图的下采样图像进行卷积,获得后向特征图;Convolve the forward feature map and the down-sampled image of the forward feature map in a backward parallel convolution channel to obtain a backward feature map;
对获得的前向特征图和后向特征图进行特征融合,得到融合特征图;Perform feature fusion on the obtained forward feature map and backward feature map to obtain a fused feature map;
利用图像分割算法对所述融合特征图进行图像分割,得到所述检测结果。Image segmentation is performed on the fusion feature map by using an image segmentation algorithm to obtain the detection result.
详细地,所述图像分割算法包括但不限于基于区域的图像分割算法、基于阈值的图像分割算法、基于边缘的图像分割算法。In detail, the image segmentation algorithm includes, but is not limited to, a region-based image segmentation algorithm, a threshold-based image segmentation algorithm, and an edge-based image segmentation algorithm.
所述前向并行卷积通道与所述后向并行卷积通道是相对而言的,例如,目标物检测模型包括4个并行卷积通道,前一个对标准训练图像进行卷积的并行卷积通道相对于后一个对标准训练图像进行卷积的并行卷积通道为前向并行卷积通道;后一个对标准训练图像进行卷积的并行卷积通道相对于前一个对标准训练图像进行卷积的并行卷积通道来说为后向并行卷积通道。The forward parallel convolution channel and the backward parallel convolution channel are relative terms. For example, the target detection model includes 4 parallel convolution channels, and the previous one is a parallel convolution that performs convolution on a standard training image. Compared with the latter, the parallel convolution channel that convolves the standard training image is the forward parallel convolution channel; the latter parallel convolution channel that convolves the standard training image is relative to the previous one that convolves the standard training image. The parallel convolution channel of is referred to as the backward parallel convolution channel.
当前向并行卷积通道为初始并行卷积通道时,后向卷积的对前向得到的结果及前向并行卷积通道的输入进行卷积,得到特征图。When the forward parallel convolution channel is the initial parallel convolution channel, the backward convolution convolves the result obtained in the forward direction and the input of the forward parallel convolution channel to obtain a feature map.
当前向并行卷积通道不为初始卷积通道时,后向卷积的对前向得到的结果及所有前向卷积通道的输入进行卷积,得到特征图。When the forward parallel convolution channel is not the initial convolution channel, the backward convolution performs convolution on the result obtained in the forward direction and the input of all forward convolution channels to obtain a feature map.
具体地,例如,在第一并行卷积通道中对所述标准训练图像进行卷积,得到第一特征图;Specifically, for example, the standard training image is convolved in the first parallel convolution channel to obtain the first feature map;
在第二并行卷积通道中对所述第一特征图及所述第一特征图的第一下采样图像进行卷积,得到第二特征图;Convolve the first feature map and the first down-sampled image of the first feature map in a second parallel convolution channel to obtain a second feature map;
在第三并行卷积通道中对所述第二特征图及所述第二特征图的第二下采样图像进行卷积,得到第三特征图;Convolve the second feature map and the second down-sampled image of the second feature map in a third parallel convolution channel to obtain a third feature map;
在第四并行卷积通道中对所述第三特征图及所述第三特征图的第三下采样图像进行卷积,得到第四特征图;Convolve the third feature map and the third down-sampled image of the third feature map in a fourth parallel convolution channel to obtain a fourth feature map;
对所述第一特征图、所述第二特征图、所述第三特征图和所述第四特征图进行特征融合得到融合特征图,并利用图像分割算法对所述融合特征图进行图像分割,得到所述检测结果。Perform feature fusion on the first feature map, the second feature map, the third feature map, and the fourth feature map to obtain a fused feature map, and use an image segmentation algorithm to perform image segmentation on the fused feature map , Get the test result.
其中,第一并行卷积通道、第一并行卷积通道、第一并行卷积通道、第一并行卷积通道以并行方式连接,以此得到同一特征的四种不同分辨率的特征图。Among them, the first parallel convolution channel, the first parallel convolution channel, the first parallel convolution channel, and the first parallel convolution channel are connected in parallel to obtain four feature maps of the same feature with different resolutions.
由于高分辨率图像含有更多的像素位置信息,更有利于位置信息的提取,低分辨率图像含有更多的特征信息,更有利于特征的识别。因此,本申请实施例中,所述目标物检测模型输出多层并行卷积通道得到的特征图的分辨率逐渐降低,特征信息也逐渐增强。所以,本申请实施例通过多层并行卷积通道得到的特征图即包含了高分辨率的位置信息,又包含 了低分辨率的特征信息,更有利于后续利用特征图进行目标物检测,提高目标物检测模型的精确度。Because high-resolution images contain more pixel location information, it is more conducive to the extraction of location information, and low-resolution images contain more feature information, which is more conducive to feature recognition. Therefore, in the embodiment of the present application, the resolution of the feature map obtained by the multi-layer parallel convolution channel output by the target detection model is gradually reduced, and the feature information is gradually enhanced. Therefore, the feature map obtained through the multi-layer parallel convolution channel in the embodiment of the present application contains both high-resolution position information and low-resolution feature information, which is more conducive to the subsequent use of feature maps for target detection and improves The accuracy of the target detection model.
所述损失函数构建模块104,用于根据所述检测结果和所述标准训练图像构建目标损失函数。The loss function construction module 104 is configured to construct a target loss function according to the detection result and the standard training image.
本申请实施例中,所述目标损失函数包括:中心点损失函数、尺寸损失函数及边界损失函数。In the embodiment of the present application, the target loss function includes: a center point loss function, a size loss function, and a boundary loss function.
详细地,所述目标损失函数为:In detail, the target loss function is:
Loss=L det+0.1×L size+L bce Loss=L det +0.1×L size +L bce
Figure PCTCN2020131992-appb-000009
Figure PCTCN2020131992-appb-000009
Figure PCTCN2020131992-appb-000010
Figure PCTCN2020131992-appb-000010
Figure PCTCN2020131992-appb-000011
Figure PCTCN2020131992-appb-000011
其中,L det为中心点损失函数,L size为尺寸损失函数,L bce为边界损失函数,C为目标物的类别的数量,H为所述标准训练图像的长度,W为所述标准训练图像的宽度,N为所述标准训练图像的数量,α、β为预设常数,p cij为预测中心点信息,y cij为标准中心点信息,s k为预测尺寸信息,
Figure PCTCN2020131992-appb-000012
为标准尺寸信息,p ij为预测边界信息,y ij为标准边界信息。
Where L det is the center point loss function, L size is the size loss function, L bce is the boundary loss function, C is the number of target categories, H is the length of the standard training image, and W is the standard training image , N is the number of the standard training images, α and β are preset constants, p cij is the prediction center point information, y cij is the standard center point information, and s k is the prediction size information,
Figure PCTCN2020131992-appb-000012
Is standard size information, p ij is prediction boundary information, and y ij is standard boundary information.
详细地,在计算中心点损失函数的函数值时,In detail, when calculating the function value of the center point loss function,
若所述预测中心点信息与所述标准中心点信息一致(即,ify cij=1),则L det为: If the predicted center point information is consistent with the standard center point information (ie, ify cij =1), then L det is:
Figure PCTCN2020131992-appb-000013
Figure PCTCN2020131992-appb-000013
若所述预测中心点信息与所述标准中心点信息不一致(即otherwise),则L det为: If the predicted center point information is inconsistent with the standard center point information (that is, otherwise), then L det is:
Figure PCTCN2020131992-appb-000014
Figure PCTCN2020131992-appb-000014
本申请实施例利用中心点损失函数、尺寸损失函数及边界损失函数组合为目标损失函数,同时利用目标物的中心点位置,尺寸大小及边界位置的三种损失值,利用三种损失值对目标物检测模型的参数进行更新,有利于提高目标物检测模型的精度。The embodiment of the application uses a combination of a center point loss function, a size loss function, and a boundary loss function as the target loss function. At the same time, three loss values of the center point position, size, and boundary position of the target are used, and the three loss values are used to target the target. The parameters of the object detection model are updated, which is beneficial to improve the accuracy of the target object detection model.
所述模型优化模块105,用于计算所述目标损失函数的损失值,根据所述损失值对所述目标物检测模型进行优化,得到标准目标物检测模型。The model optimization module 105 is configured to calculate the loss value of the target loss function, and optimize the target detection model according to the loss value to obtain a standard target detection model.
所述模型优化模块105具体用于:The model optimization module 105 is specifically used for:
计算所述目标损失函数的损失值;Calculating the loss value of the target loss function;
当所述目标损失函数的损失值大于预设的损失阈值,则利用优化算法对所述目标物检测模型的参数进行优化;When the loss value of the target loss function is greater than the preset loss threshold, an optimization algorithm is used to optimize the parameters of the target detection model;
当所述目标损失函数的损失值小于或等于所述损失阈值,得到标准目标物检测模型。When the loss value of the target loss function is less than or equal to the loss threshold, a standard target detection model is obtained.
本申请实施例中,当所述目标损失函数的损失值大于预设的损失阈值,使用Adam优化算法对目标物检测模型的参数进行优化,Adam优化算法可自适应调节目标物检测模型训练过程中的学习率,使得目标物检测模型更加精确,提升目标物检测模型的性能。In the embodiment of this application, when the loss value of the target loss function is greater than the preset loss threshold, the Adam optimization algorithm is used to optimize the parameters of the target detection model. The Adam optimization algorithm can adaptively adjust the target detection model training process The learning rate makes the target detection model more accurate and improves the performance of the target detection model.
所述标准检测模块106,用于获取待检测目标物图像,利用所述标准目标物检测模型对所述待检测目标物图像进行图像检测,得到标准检测结果。The standard detection module 106 is configured to obtain an image of a target object to be detected, and use the standard target object detection model to perform image detection on the image of the target object to be detected to obtain a standard detection result.
本申请实施例中,所述待检测目标物图像包括生物体组织的医学图像。所述待检测病 灶图像可由用户通过用户端程序进行上传,当获取到待检测病灶图像后,将所述待检测病灶图像输入至标准病灶检测模型进行病灶检测,得到标准检测结果。In the embodiment of the present application, the image of the target object to be detected includes a medical image of a biological tissue. The image of the lesion to be detected can be uploaded by the user through a user-side program. When the image of the lesion to be detected is obtained, the image of the lesion to be detected is input to the standard lesion detection model for lesion detection, and the standard detection result is obtained.
本申请实施例通过对训练图像进行降噪处理,提高训练图像的质量,进而提高利用训练图像训练得到的目标物检测模型的精确性;通过构建目标损失函数分别计算目标物检测模型对目标物输出的预测中心点信息、预测尺寸信息及预测边界信息的三种损失值,利用三种损失值对目标物检测模型的参数进行更新,提高了目标物检测模型输出的目标物的大小、尺寸及位置的精确性;获取待检测目标物图像,利用标准目标物检测模型对待检测目标物图像进行图像检测,无需人工进行图像分析,提高了图像中目标物的检测效率。因此本申请提出的图像中目标物的检测装置,可以提高图像中目标物的检测的效率及准确度。The embodiment of the application improves the quality of the training image by denoising the training image, and further improves the accuracy of the target detection model trained by the training image; the target detection model is calculated separately by constructing the target loss function to output the target. The three loss values of predicted center point information, predicted size information and predicted boundary information are used to update the parameters of the target detection model by using the three loss values to improve the size, size and position of the target output by the target detection model The accuracy of the target object to be detected is acquired, and the standard target object detection model is used to perform image detection on the image of the target object to be detected, without manual image analysis, which improves the detection efficiency of the target object in the image. Therefore, the device for detecting a target in an image proposed in this application can improve the efficiency and accuracy of detecting the target in the image.
如图5所示,是本申请实现图像中目标物的检测方法的电子设备的结构示意图。As shown in FIG. 5, it is a schematic structural diagram of an electronic device that implements the method for detecting a target object in an image according to the present application.
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如图像中目标物的检测程序12。The electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a target detection program 12 in an image.
其中,所述存储器11至少包括一种类型的可读存储介质,存储器11可以是易失性的,也可以是非易失性的。所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如图像中目标物的检测程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the memory 11 may be volatile or non-volatile. The readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can be used not only to store application software and various data installed in the electronic device 1, such as the code of the target detection program 12 in the image, etc., but also to temporarily store data that has been output or will be output.
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行图像中目标物的检测程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。The processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc. The processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules stored in the memory 11 (such as executing The detection program of the target in the image, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
图5仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图5示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 5 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 5 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or a combination of certain components, or different component arrangements.
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling power The device implements functions such as charge management, discharge management, and power consumption management. The power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators. The electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。Further, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and/or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may also include a user interface. The user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)). Optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only for illustrative purposes, and are not limited by this structure in the scope of the patent application.
所述电子设备1中的所述存储器11存储的图像中目标物的检测程序12是多个计算机程序的组合,在所述处理器10中运行时,可以实现:The detection program 12 of the target object in the image stored in the memory 11 in the electronic device 1 is a combination of multiple computer programs. When running in the processor 10, it can realize:
获取训练图像,对所述训练图像进行降噪处理,得到标准训练图像,其中,所述训练图像包括目标物的标准中心点信息、标准尺寸信息及标准边界信息;Acquiring a training image, performing noise reduction processing on the training image to obtain a standard training image, wherein the training image includes standard center point information, standard size information, and standard boundary information of the target object;
构建目标物检测模型;Build a target detection model;
利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,其中,所述检测结果包括目标物的预测中心点信息、预测尺寸信息及预测边界信息;Performing target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes predicted center point information, predicted size information, and predicted boundary information of the target;
根据所述检测结果和所述标准训练图像构建目标损失函数;Constructing a target loss function according to the detection result and the standard training image;
计算所述目标损失函数的损失值,根据所述损失值对所述目标物检测模型进行优化,得到标准目标物检测模型;Calculating the loss value of the target loss function, and optimizing the target detection model according to the loss value to obtain a standard target detection model;
获取待检测目标物图像,利用所述标准目标物检测模型对所述待检测目标物图像进行图像检测,得到标准检测结果。An image of the target to be detected is acquired, and the standard target detection model is used to perform image detection on the image of the target to be detected to obtain a standard detection result.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中,所述计算机可读存储介质可以是易失性的,也可以是非易失性的。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Further, if the integrated module/unit of the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. It can be volatile or non-volatile. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
进一步地,所述计算机可用存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作***、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store a block chain node Use the created data, etc.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed equipment, device, and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。For those skilled in the art, it is obvious that the present application is not limited to the details of the foregoing exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or basic characteristics of the application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图表记视为限制所涉及的权利要求。Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description, and therefore it is intended to fall into the claims. All changes in the meaning and scope of the equivalent elements of are included in this application. Any associated diagrams in the claims should not be regarded as limiting the claims involved.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验 证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。***权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。In addition, it is obvious that the word "including" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claims can also be implemented by one unit or device through software or hardware. The second class words are used to indicate names, and do not indicate any specific order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application and not to limit them. Although the application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the application can be Make modifications or equivalent replacements without departing from the spirit and scope of the technical solution of the present application.

Claims (20)

  1. 一种图像中目标物的检测方法,其中,所述方法包括:A method for detecting a target in an image, wherein the method includes:
    获取训练图像,对所述训练图像进行降噪处理,得到标准训练图像,其中,所述训练图像包括目标物的标准中心点信息、标准尺寸信息及标准边界信息;Acquiring a training image, performing noise reduction processing on the training image to obtain a standard training image, wherein the training image includes standard center point information, standard size information, and standard boundary information of the target object;
    构建目标物检测模型;Build a target detection model;
    利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,其中,所述检测结果包括目标物的预测中心点信息、预测尺寸信息及预测边界信息;Performing target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes predicted center point information, predicted size information, and predicted boundary information of the target;
    根据所述检测结果和所述标准训练图像构建目标损失函数;Constructing a target loss function according to the detection result and the standard training image;
    计算所述目标损失函数的损失值,根据所述损失值对所述目标物检测模型进行优化,得到标准目标物检测模型;Calculating the loss value of the target loss function, and optimizing the target detection model according to the loss value to obtain a standard target detection model;
    获取待检测目标物图像,利用所述标准目标物检测模型对所述待检测目标物图像进行图像检测,得到标准检测结果。An image of the target to be detected is acquired, and the standard target detection model is used to perform image detection on the image of the target to be detected to obtain a standard detection result.
  2. 如权利要求1所述的图像中目标物的检测方法,其中,所述目标物检测模型包括多个不同分辨率的并行卷积通道。The method for detecting a target in an image according to claim 1, wherein the target detection model includes a plurality of parallel convolution channels with different resolutions.
  3. 如权利要求2所述的图像中目标物的检测方法,其中,所述利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,包括:3. The method for detecting a target in an image according to claim 2, wherein said using said target detection model to perform target detection on said standard training image to obtain a detection result comprises:
    获取在前向并行卷积通道中基于所述标准训练图像集进行卷积得到的前向特征图;Acquiring a forward feature map obtained by convolution based on the standard training image set in a forward parallel convolution channel;
    在后向并行卷积通道中对所述前向特征图及所述前向特征图的下采样图像进行卷积,获得后向特征图;Convolve the forward feature map and the down-sampled image of the forward feature map in a backward parallel convolution channel to obtain a backward feature map;
    对获得的前向特征图和后向特征图进行特征融合,得到融合特征图;Perform feature fusion on the obtained forward feature map and backward feature map to obtain a fused feature map;
    利用图像分割算法对所述融合特征图进行图像分割,得到所述检测结果。Image segmentation is performed on the fusion feature map by using an image segmentation algorithm to obtain the detection result.
  4. 如权利要求1所述的图像中目标物的检测方法,其中,所述目标损失函数包括:中心点损失函数、尺寸损失函数及边界损失函数。8. The method for detecting a target in an image according to claim 1, wherein the target loss function includes: a center point loss function, a size loss function, and a boundary loss function.
  5. 如权利要求1所述的图像中目标物的检测方法,其中,所述待检测目标物图像包括生物体组织的医学图像。The method for detecting a target in an image according to claim 1, wherein the image of the target to be detected includes a medical image of a biological tissue.
  6. 如权利要求1至5中任一项所述的图像中目标物的检测方法,其中,所述对所述训练图像进行降噪处理,得到标准训练图像,包括:The method for detecting a target in an image according to any one of claims 1 to 5, wherein the performing noise reduction processing on the training image to obtain a standard training image includes:
    计算所述训练图像中所有像素点的像素均值;Calculating the pixel mean value of all pixels in the training image;
    将所述训练图像中所有大于或等于所述像素均值的像素点的像素值置为第一数值,将所述训练图像中所有大于或等于所述像素均值的像素点的像素值置为第二数值,得到归一化图像;Set the pixel values of all pixels in the training image that are greater than or equal to the pixel average value to a first value, and set the pixel values of all pixels that are greater than or equal to the pixel average value in the training image to a second value Numerical value to get the normalized image;
    随机获取所述归一化图像中目标像素点,计算所述目标像素点的预设邻域内的像素均值;Randomly acquiring a target pixel in the normalized image, and calculating an average value of pixels in a preset neighborhood of the target pixel;
    将所述目标像素点的像素值利用所述像素均值进行替换,得到均值图像;Replacing the pixel value of the target pixel with the pixel average value to obtain an average value image;
    删除所述均值图像中所有像素值为第二数值的像素点,得到标准训练图像。Delete all the pixels with the second value in the average image to obtain a standard training image.
  7. 如权利要求6所述的图像中目标物的检测方法,其中,所述计算所述目标像素点的预设邻域内的像素均值,包括:7. The method for detecting a target in an image according to claim 6, wherein said calculating the average value of pixels in a preset neighborhood of said target pixel comprises:
    利用如下均值计算公式计算所述预设邻域内的像素均值:The following average value calculation formula is used to calculate the average value of pixels in the preset neighborhood:
    Figure PCTCN2020131992-appb-100001
    Figure PCTCN2020131992-appb-100001
    其中,f(j,k)为预设邻域内的像素点(j,k);g(x,y)为所述像素均值,W为预设邻域;j,k为预设邻域内像素点的坐标;med为均值处理运算,N为预设邻域内像素点的数量。Where f(j,k) is the pixel point (j,k) in the preset neighborhood; g(x,y) is the average value of the pixel, W is the preset neighborhood; j,k is the pixel in the preset neighborhood The coordinates of the point; med is the mean value processing operation, and N is the number of pixels in the preset neighborhood.
  8. 一种图像中目标物的检测装置,其中,所述装置包括:A detection device for a target in an image, wherein the device includes:
    图像降噪模块,用于获取训练图像,对所述训练图像进行降噪处理,得到标准训练图 像,其中,所述训练图像包括目标物的标准中心点信息、标准尺寸信息及标准边界信息;The image noise reduction module is used to obtain training images, and perform noise reduction processing on the training images to obtain standard training images, where the training images include standard center point information, standard size information, and standard boundary information of the target;
    模型构建模块,用于构建目标物检测模型;Model building module, used to build a target detection model;
    目标物检测模块,用于利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,其中,所述检测结果包括目标物的预测中心点信息、预测尺寸信息及预测边界信息;The target detection module is used to perform target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes the predicted center point information, predicted size information, and predicted boundary of the target information;
    损失函数构建模块,用于根据所述检测结果和所述标准训练图像构建目标损失函数;A loss function construction module, configured to construct a target loss function according to the detection result and the standard training image;
    模型优化模块,用于计算所述目标损失函数的损失值,根据所述损失值对所述目标物检测模型进行优化,得到标准目标物检测模型;A model optimization module is used to calculate the loss value of the target loss function, and optimize the target detection model according to the loss value to obtain a standard target detection model;
    标准检测模块,用于获取待检测目标物图像,利用所述标准目标物检测模型对所述待检测目标物图像进行图像检测,得到标准检测结果。The standard detection module is used to obtain an image of a target object to be detected, and use the standard target object detection model to perform image detection on the image of the target object to be detected to obtain a standard detection result.
  9. 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device includes:
    至少一个处理器;以及,At least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute the following steps:
    获取训练图像,对所述训练图像进行降噪处理,得到标准训练图像,其中,所述训练图像包括目标物的标准中心点信息、标准尺寸信息及标准边界信息;Acquiring a training image, performing noise reduction processing on the training image to obtain a standard training image, wherein the training image includes standard center point information, standard size information, and standard boundary information of the target object;
    构建目标物检测模型;Build a target detection model;
    利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,其中,所述检测结果包括目标物的预测中心点信息、预测尺寸信息及预测边界信息;Performing target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes predicted center point information, predicted size information, and predicted boundary information of the target;
    根据所述检测结果和所述标准训练图像构建目标损失函数;Constructing a target loss function according to the detection result and the standard training image;
    计算所述目标损失函数的损失值,根据所述损失值对所述目标物检测模型进行优化,得到标准目标物检测模型;Calculating the loss value of the target loss function, and optimizing the target detection model according to the loss value to obtain a standard target detection model;
    获取待检测目标物图像,利用所述标准目标物检测模型对所述待检测目标物图像进行图像检测,得到标准检测结果。An image of the target to be detected is acquired, and the standard target detection model is used to perform image detection on the image of the target to be detected to obtain a standard detection result.
  10. 如权利要求9所述的电子设备,其中,所述目标物检测模型包括多个不同分辨率的并行卷积通道。9. The electronic device of claim 9, wherein the target detection model includes a plurality of parallel convolution channels with different resolutions.
  11. 如权利要求10所述的电子设备,其中,所述利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,包括:11. The electronic device according to claim 10, wherein said using said target detection model to perform target detection on said standard training image to obtain a detection result comprises:
    获取在前向并行卷积通道中基于所述标准训练图像集进行卷积得到的前向特征图;Acquiring a forward feature map obtained by convolution based on the standard training image set in a forward parallel convolution channel;
    在后向并行卷积通道中对所述前向特征图及所述前向特征图的下采样图像进行卷积,获得后向特征图;Convolve the forward feature map and the down-sampled image of the forward feature map in a backward parallel convolution channel to obtain a backward feature map;
    对获得的前向特征图和后向特征图进行特征融合,得到融合特征图;Perform feature fusion on the obtained forward feature map and backward feature map to obtain a fused feature map;
    利用图像分割算法对所述融合特征图进行图像分割,得到所述检测结果。Image segmentation is performed on the fusion feature map by using an image segmentation algorithm to obtain the detection result.
  12. 如权利要求9所述的电子设备,其中,所述目标损失函数包括:中心点损失函数、尺寸损失函数及边界损失函数。9. The electronic device of claim 9, wherein the target loss function comprises: a center point loss function, a size loss function, and a boundary loss function.
  13. 如权利要求9所述的电子设备,其中,所述待检测目标物图像包括生物体组织的医学图像。9. The electronic device according to claim 9, wherein the image of the object to be detected includes a medical image of a biological tissue.
  14. 如权利要求9至13中任一项所述的电子设备,其中,所述对所述训练图像进行降噪处理,得到标准训练图像,包括:The electronic device according to any one of claims 9 to 13, wherein the performing noise reduction processing on the training image to obtain a standard training image comprises:
    计算所述训练图像中所有像素点的像素均值;Calculating the pixel mean value of all pixels in the training image;
    将所述训练图像中所有大于或等于所述像素均值的像素点的像素值置为第一数值,将所述训练图像中所有大于或等于所述像素均值的像素点的像素值置为第二数值,得到归一化图像;Set the pixel values of all pixels in the training image that are greater than or equal to the pixel average value to a first value, and set the pixel values of all pixels that are greater than or equal to the pixel average value in the training image to a second value Numerical value to get the normalized image;
    随机获取所述归一化图像中目标像素点,计算所述目标像素点的预设邻域内的像素均 值;Randomly acquiring a target pixel in the normalized image, and calculating an average value of pixels in a preset neighborhood of the target pixel;
    将所述目标像素点的像素值利用所述像素均值进行替换,得到均值图像;Replacing the pixel value of the target pixel with the pixel average value to obtain an average value image;
    删除所述均值图像中所有像素值为第二数值的像素点,得到标准训练图像。Delete all the pixels with the second value in the average image to obtain a standard training image.
  15. 如权利要求14所述的电子设备,其中,所述计算所述目标像素点的预设邻域内的像素均值,包括:The electronic device according to claim 14, wherein the calculating the average value of pixels in the preset neighborhood of the target pixel point comprises:
    利用如下均值计算公式计算所述预设邻域内的像素均值:The following average value calculation formula is used to calculate the average value of pixels in the preset neighborhood:
    Figure PCTCN2020131992-appb-100002
    Figure PCTCN2020131992-appb-100002
    其中,f(j,k)为预设邻域内的像素点(j,k);g(x,y)为所述像素均值,W为预设邻域;j,k为预设邻域内像素点的坐标;med为均值处理运算,N为预设邻域内像素点的数量。Where f(j,k) is the pixel point (j,k) in the preset neighborhood; g(x,y) is the average value of the pixel, W is the preset neighborhood; j,k is the pixel in the preset neighborhood The coordinates of the point; med is the mean value processing operation, and N is the number of pixels in the preset neighborhood.
  16. 一种计算机可读存储介质,包括存储数据区和存储程序区,其中,所述存储数据区存储创建的数据,所述存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium includes a storage data area and a storage program area, wherein the storage data area stores created data, and the storage program area stores a computer program; wherein, when the computer program is executed by a processor To achieve the following steps:
    获取训练图像,对所述训练图像进行降噪处理,得到标准训练图像,其中,所述训练图像包括目标物的标准中心点信息、标准尺寸信息及标准边界信息;Acquiring a training image, performing noise reduction processing on the training image to obtain a standard training image, wherein the training image includes standard center point information, standard size information, and standard boundary information of the target object;
    构建目标物检测模型;Build a target detection model;
    利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,其中,所述检测结果包括目标物的预测中心点信息、预测尺寸信息及预测边界信息;Performing target detection on the standard training image by using the target detection model to obtain a detection result, wherein the detection result includes predicted center point information, predicted size information, and predicted boundary information of the target;
    根据所述检测结果和所述标准训练图像构建目标损失函数;Constructing a target loss function according to the detection result and the standard training image;
    计算所述目标损失函数的损失值,根据所述损失值对所述目标物检测模型进行优化,得到标准目标物检测模型;Calculating the loss value of the target loss function, and optimizing the target detection model according to the loss value to obtain a standard target detection model;
    获取待检测目标物图像,利用所述标准目标物检测模型对所述待检测目标物图像进行图像检测,得到标准检测结果。An image of the target to be detected is acquired, and the standard target detection model is used to perform image detection on the image of the target to be detected to obtain a standard detection result.
  17. 如权利要求16所述的计算机可读存储介质,其中,所述目标物检测模型包括多个不同分辨率的并行卷积通道。16. The computer-readable storage medium of claim 16, wherein the target detection model includes a plurality of parallel convolution channels with different resolutions.
  18. 如权利要求17所述的计算机可读存储介质,其中,所述利用所述目标物检测模型对所述标准训练图像进行目标物检测,得到检测结果,包括:17. The computer-readable storage medium of claim 17, wherein said using said target detection model to perform target detection on said standard training image to obtain a detection result comprises:
    获取在前向并行卷积通道中基于所述标准训练图像集进行卷积得到的前向特征图;Acquiring a forward feature map obtained by convolution based on the standard training image set in a forward parallel convolution channel;
    在后向并行卷积通道中对所述前向特征图及所述前向特征图的下采样图像进行卷积,获得后向特征图;Convolve the forward feature map and the down-sampled image of the forward feature map in a backward parallel convolution channel to obtain a backward feature map;
    对获得的前向特征图和后向特征图进行特征融合,得到融合特征图;Perform feature fusion on the obtained forward feature map and backward feature map to obtain a fused feature map;
    利用图像分割算法对所述融合特征图进行图像分割,得到所述检测结果。Image segmentation is performed on the fusion feature map by using an image segmentation algorithm to obtain the detection result.
  19. 如权利要求16所述的计算机可读存储介质,其中,所述目标损失函数包括:中心点损失函数、尺寸损失函数及边界损失函数。16. The computer-readable storage medium of claim 16, wherein the target loss function comprises: a center point loss function, a size loss function, and a boundary loss function.
  20. 如权利要求16所述的计算机可读存储介质,其中,所述待检测目标物图像包括生物体组织的医学图像。16. The computer-readable storage medium of claim 16, wherein the image of the object to be detected includes a medical image of a biological tissue.
PCT/CN2020/131992 2020-09-25 2020-11-27 Method and apparatus for detecting target object in image, and electronic device and storage medium WO2021189912A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011023942.3 2020-09-25
CN202011023942.3A CN111932482B (en) 2020-09-25 2020-09-25 Method and device for detecting target object in image, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2021189912A1 true WO2021189912A1 (en) 2021-09-30

Family

ID=73334774

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/131992 WO2021189912A1 (en) 2020-09-25 2020-11-27 Method and apparatus for detecting target object in image, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN111932482B (en)
WO (1) WO2021189912A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113610069A (en) * 2021-10-11 2021-11-05 北京文安智能技术股份有限公司 Knowledge distillation-based target detection model training method
CN114241411A (en) * 2021-12-15 2022-03-25 平安科技(深圳)有限公司 Counting model processing method and device based on target detection and computer equipment
CN114758249A (en) * 2022-06-14 2022-07-15 深圳市优威视讯科技股份有限公司 Target object monitoring method, device, equipment and medium based on field night environment
CN114972303A (en) * 2022-06-16 2022-08-30 平安科技(深圳)有限公司 Image acquisition method and device, electronic equipment and storage medium
CN115690853A (en) * 2022-12-30 2023-02-03 广州蚁窝智能科技有限公司 Gesture recognition method and electric sanitary cover opening and closing control system

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111932482B (en) * 2020-09-25 2021-05-18 平安科技(深圳)有限公司 Method and device for detecting target object in image, electronic equipment and storage medium
CN112581522B (en) * 2020-11-30 2024-05-07 平安科技(深圳)有限公司 Method and device for detecting position of target in image, electronic equipment and storage medium
CN112465060A (en) * 2020-12-10 2021-03-09 平安科技(深圳)有限公司 Method and device for detecting target object in image, electronic equipment and readable storage medium
CN113160144B (en) * 2021-03-25 2023-05-26 平安科技(深圳)有限公司 Target object detection method, target object detection device, electronic equipment and storage medium
CN113222890B (en) * 2021-03-30 2023-09-15 平安科技(深圳)有限公司 Small target object detection method and device, electronic equipment and storage medium
CN113159147B (en) * 2021-04-08 2023-09-26 平安科技(深圳)有限公司 Image recognition method and device based on neural network and electronic equipment
CN113537070B (en) * 2021-07-19 2022-11-22 中国第一汽车股份有限公司 Detection method, detection device, electronic equipment and storage medium
CN113780291A (en) * 2021-08-25 2021-12-10 北京达佳互联信息技术有限公司 Image processing method and device, electronic equipment and storage medium
CN115984269B (en) * 2023-03-20 2023-07-14 湖南长理尚洋科技有限公司 Non-invasive local water ecological safety detection method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107665736A (en) * 2017-09-30 2018-02-06 百度在线网络技术(北京)有限公司 Method and apparatus for generating information
US20200005460A1 (en) * 2018-06-28 2020-01-02 Shenzhen Imsight Medical Technology Co. Ltd. Method and device for detecting pulmonary nodule in computed tomography image, and computer-readable storage medium
CN110880177A (en) * 2019-11-26 2020-03-13 北京推想科技有限公司 Image identification method and device
CN111402226A (en) * 2020-03-13 2020-07-10 浙江工业大学 Surface defect detection method based on cascade convolution neural network
CN111932482A (en) * 2020-09-25 2020-11-13 平安科技(深圳)有限公司 Method and device for detecting target object in image, electronic equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10304193B1 (en) * 2018-08-17 2019-05-28 12 Sigma Technologies Image segmentation and object detection using fully convolutional neural network
CN110599451B (en) * 2019-08-05 2023-01-20 平安科技(深圳)有限公司 Medical image focus detection and positioning method, device, equipment and storage medium
CN110705555B (en) * 2019-09-17 2022-06-14 中山大学 Abdomen multi-organ nuclear magnetic resonance image segmentation method, system and medium based on FCN
CN110674866B (en) * 2019-09-23 2021-05-07 兰州理工大学 Method for detecting X-ray breast lesion images by using transfer learning characteristic pyramid network
CN110942446A (en) * 2019-10-17 2020-03-31 付冲 Pulmonary nodule automatic detection method based on CT image
CN111597933B (en) * 2020-04-30 2023-07-14 合肥的卢深视科技有限公司 Face recognition method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107665736A (en) * 2017-09-30 2018-02-06 百度在线网络技术(北京)有限公司 Method and apparatus for generating information
US20200005460A1 (en) * 2018-06-28 2020-01-02 Shenzhen Imsight Medical Technology Co. Ltd. Method and device for detecting pulmonary nodule in computed tomography image, and computer-readable storage medium
CN110880177A (en) * 2019-11-26 2020-03-13 北京推想科技有限公司 Image identification method and device
CN111402226A (en) * 2020-03-13 2020-07-10 浙江工业大学 Surface defect detection method based on cascade convolution neural network
CN111932482A (en) * 2020-09-25 2020-11-13 平安科技(深圳)有限公司 Method and device for detecting target object in image, electronic equipment and storage medium

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113610069A (en) * 2021-10-11 2021-11-05 北京文安智能技术股份有限公司 Knowledge distillation-based target detection model training method
CN113610069B (en) * 2021-10-11 2022-02-08 北京文安智能技术股份有限公司 Knowledge distillation-based target detection model training method
CN114241411A (en) * 2021-12-15 2022-03-25 平安科技(深圳)有限公司 Counting model processing method and device based on target detection and computer equipment
CN114241411B (en) * 2021-12-15 2024-04-09 平安科技(深圳)有限公司 Counting model processing method and device based on target detection and computer equipment
CN114758249A (en) * 2022-06-14 2022-07-15 深圳市优威视讯科技股份有限公司 Target object monitoring method, device, equipment and medium based on field night environment
CN114758249B (en) * 2022-06-14 2022-09-02 深圳市优威视讯科技股份有限公司 Target object monitoring method, device, equipment and medium based on field night environment
CN114972303A (en) * 2022-06-16 2022-08-30 平安科技(深圳)有限公司 Image acquisition method and device, electronic equipment and storage medium
CN115690853A (en) * 2022-12-30 2023-02-03 广州蚁窝智能科技有限公司 Gesture recognition method and electric sanitary cover opening and closing control system
CN115690853B (en) * 2022-12-30 2023-04-28 广州蚁窝智能科技有限公司 Gesture recognition method and electric sanitary cover opening and closing control system

Also Published As

Publication number Publication date
CN111932482A (en) 2020-11-13
CN111932482B (en) 2021-05-18

Similar Documents

Publication Publication Date Title
WO2021189912A1 (en) Method and apparatus for detecting target object in image, and electronic device and storage medium
WO2022121156A1 (en) Method and apparatus for detecting target object in image, electronic device and readable storage medium
WO2021217851A1 (en) Abnormal cell automatic labeling method and apparatus, electronic device, and storage medium
CN111047609B (en) Pneumonia focus segmentation method and device
WO2022110712A1 (en) Image enhancement method and apparatus, electronic device and computer readable storage medium
WO2021189909A1 (en) Lesion detection and analysis method and apparatus, and electronic device and computer storage medium
CN110059697B (en) Automatic lung nodule segmentation method based on deep learning
WO2021189901A1 (en) Image segmentation method and apparatus, and electronic device and computer-readable storage medium
WO2020253508A1 (en) Abnormal cell detection method and apparatus, and computer readable storage medium
WO2021189913A1 (en) Method and apparatus for target object segmentation in image, and electronic device and storage medium
WO2021151338A1 (en) Medical imagery analysis method, apparatus, electronic device and readable storage medium
WO2021189910A1 (en) Image recognition method and apparatus, and electronic device and computer-readable storage medium
WO2022116424A1 (en) Method and apparatus for training traffic flow prediction model, electronic device, and storage medium
WO2021189855A1 (en) Image recognition method and apparatus based on ct sequence, and electronic device and medium
WO2021189911A1 (en) Target object position detection method and apparatus based on video stream, and device and medium
CN111862096B (en) Image segmentation method and device, electronic equipment and storage medium
WO2021189848A1 (en) Model training method and apparatus, cup-to-disc ratio determination method and apparatus, and device and storage medium
WO2021189827A1 (en) Method and apparatus for recognizing blurred image, and device and computer-readable storage medium
WO2021151307A1 (en) Integrated method, apparatus, device, and medium based on pathological section scanning and analysis
CN113065609B (en) Image classification method, device, electronic equipment and readable storage medium
WO2021189856A1 (en) Certificate check method and apparatus, and electronic device and medium
WO2021184576A1 (en) Medical image generation method and apparatus, electronic device and medium
WO2021189914A1 (en) Electronic device, medical image index generation method and apparatus, and storage medium
CN111275707A (en) Pneumonia focus segmentation method and device
WO2021168703A1 (en) Character processing and identifying methods, storage medium, and terminal device

Legal Events

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

Ref document number: 20926583

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20926583

Country of ref document: EP

Kind code of ref document: A1