Monopolar object imaging method, device, computer equipment and storage medium
By acquiring and adjusting the focal loss state value of the unipolar object image, the problem of insufficient accuracy of traditional unipolar detectors is solved, the image imaging rate and resolution are improved, and the target can be correctly identified.
Patent Information
- Application Number
- CN202110579326.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-26
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2041-05-26
AI Technical Summary
Traditional unipolar detectors are relatively backward in accuracy, resulting in ineffective imaging, thereby reducing the image imaging rate and unable to correctly identify the target.
By acquiring the focal loss state value of the single-pole object image, performing alternating loss operations and difference operations, adjusting the focal loss adjustment factor, so that the focal loss state value matches the preset focal loss value, thereby improving the image imaging rate.
The imaging rate of the unipolar object image is effectively improved, the focus loss is reduced, and the resolution of the image is improved, so that objects with too small imaging can be clearly displayed and marked.
Smart Images

Figure CN113313729B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle aerial photography, and in particular to a monopole object image imaging method, device, computer equipment and storage medium. Background Art
[0002] Drone reconnaissance is gradually replacing manual reconnaissance, reducing labor costs and improving reconnaissance efficiency. Traditional drones use aerial cameras to take aerial photos of the ground during navigation to obtain aerial images of the ground. Object detectors are usually used to analyze aerial images. The most accurate object detector currently works based on the two-stage method promoted by RCNN (Region Convolutional Neural Networks). Classifiers are widely used, and single-pole detectors are used for possible targets with dense rules, which is beneficial for better sampling.
[0003] However, traditional monopole detectors lag behind in terms of accuracy. When detecting dense targets, the sampling speed is fast, but its accuracy is too low, resulting in invalid imaging, which in turn causes the imaging rate of the image ultimately used for identification to decrease, making it impossible to correctly identify the image. Summary of the invention
[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and to provide a method, device, computer equipment and storage medium for imaging a monopolar object with improved imaging rate.
[0005] The objective of the present invention is achieved through the following technical solutions:
[0006] A monopolar object imaging method, the method comprising:
[0007] Acquire a monopolar object image;
[0008] Acquiring scene parameters according to the monopole object image;
[0009] Performing an alternating loss operation on the scene image parameters to obtain a focal loss state value;
[0010] Performing a residual operation on the focal loss state value and a preset focal loss value to obtain a focal loss differential value;
[0011] A focus loss adjustment factor is adjusted according to the focus loss differential value so that the focus loss state value matches the preset focus loss value.
[0012] In one of the embodiments, the acquiring of scene image parameters according to the monopole object image includes: acquiring foreground image parameters according to the monopole object image; and calibrating corresponding first classification values for the foreground image parameters.
[0013] In one of the embodiments, the step of acquiring scene parameters according to the monopole object image further includes: acquiring background image parameters according to the monopole object image; and calibrating corresponding second classification values for the background image parameters.
[0014] In one of the embodiments, performing an alternating loss operation on the scene parameters to obtain a focal loss state value includes: performing a cross entropy loss process on the scene parameters to obtain an entropy loss value and a corresponding classification probability.
[0015] In one of the embodiments, the cross entropy loss processing is performed on the scene parameters to obtain an entropy loss value and a corresponding classification probability, and then the method further includes: performing focal loss processing on the entropy loss value and the classification probability to obtain a focal loss state value.
[0016] In one of the embodiments, adjusting the focus loss adjustment factor according to the focus loss differential value includes: detecting whether the focus loss differential value is greater than a preset differential value; and when the focus loss differential value is greater than the preset differential value, increasing the focus loss adjustment factor.
[0017] In one of the embodiments, the detecting whether the focal loss differential value is greater than a preset differential value further includes: when the focal loss differential value is less than or equal to the preset differential value, acquiring and maintaining a current focal loss adjustment factor.
[0018] A monopolar object imaging device, the device comprising:
[0019] An image acquisition module, used for acquiring a monopolar object image;
[0020] An image conversion module, used for acquiring scene parameters according to the monopole object image;
[0021] A first processing module is used to perform an alternating loss operation on the scene image parameters to obtain a focal loss state value;
[0022] A second processing module is used to perform a residual operation on the focal loss state value and a preset focal loss value to obtain a focal loss differential value;
[0023] An adjustment processing module is used to adjust the focal loss adjustment factor according to the focal loss differential value so that the focal loss state value matches the preset focal loss value.
[0024] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0025] Acquire a monopolar object image;
[0026] Acquiring scene parameters according to the monopole object image;
[0027] Performing an alternating loss operation on the scene image parameters to obtain a focal loss state value;
[0028] Performing a residual operation on the focal loss state value and a preset focal loss value to obtain a focal loss differential value;
[0029] A focus loss adjustment factor is adjusted according to the focus loss differential value so that the focus loss state value matches the preset focus loss value.
[0030] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0031] Acquire a monopolar object image;
[0032] Acquiring scene parameters according to the monopole object image;
[0033] Performing an alternating loss operation on the scene image parameters to obtain a focal loss state value;
[0034] Performing a residual operation on the focal loss state value and a preset focal loss value to obtain a focal loss differential value;
[0035] A focus loss adjustment factor is adjusted according to the focus loss differential value so that the focus loss state value matches the preset focus loss value.
[0036] Compared with the prior art, the present invention has at least the following advantages:
[0037] A focus loss state value is obtained for the monopole object image, and the focus loss state value is used to reflect the resolution level of the monopole object image. A focus loss difference value is obtained by comparing the focus loss state value with a preset focus loss value, which reflects the difference between the resolution of the current monopole object image and the resolution of the clear image. Finally, the focus loss adjustment factor is adjusted according to the focus loss difference value, and the focus loss state value is effectively adjusted, so that the focus loss of the monopole object image after imaging is reduced, thereby improving the imaging rate of the monopole object image. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 is a flow chart of a method for imaging a monopolar object in one embodiment;
[0040] Figure 2 1 is a diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0041] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thoroughly understood.
[0042] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only and do not represent the only implementation method.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0044] The present invention relates to a monopolar object image imaging method. In one embodiment, the monopolar object image imaging method comprises: acquiring a monopolar object image; acquiring a scene image parameter according to the monopolar object image; performing an alternating loss operation on the scene image parameter to obtain a focal loss state value; performing a residual operation on the focal loss state value and a preset focal loss value to obtain a focal loss differential value; adjusting a focal loss adjustment factor according to the focal loss differential value to make the focal loss state value match the preset focal loss value. The focal loss state value is obtained by acquiring the monopolar object image, and the focal loss state value is used to reflect the resolution level of the monopolar object image. By comparing the focal loss state value with the preset focal loss value, the focal loss differential value obtained is a reflection of the difference between the resolution of the current monopolar object image and the resolution of the clear image. Finally, the focal loss adjustment factor is adjusted according to the focal loss differential value, and the focal loss state value is effectively adjusted, so that the focal loss after the monopolar object image is imaged is reduced, thereby improving the imaging rate of the monopolar object image.
[0045] See also Figure 1 , which is a flow chart of a monopolar object imaging method according to an embodiment of the present invention. The monopolar object imaging method includes part or all of the following steps.
[0046] S100: Acquire a monopolar object image.
[0047] In this embodiment, the monopole object image is an image acquired by a monopole object detector. For example, after the aerial camera acquires the aerial image, the monopole object detector performs image initialization processing on the aerial image, and converts the aerial image into monopole object images of multiple levels. The monopole object detector has the effects of acquisition and classification, which facilitates the subsequent analysis and processing of each image target of the background image.
[0048] S200: Acquire scene parameters according to the monopole object image.
[0049] In this embodiment, the scene image parameters are numerical conversions of target samples of the monopole object image, and the target samples correspond to sample images formed by the aggregation of multiple pixel points in the background image. Moreover, the target samples are used to present sample images of specific targets in the aerial image. For example, for target images with a small imaging area, various target images at different resolutions in the monopole object image are collected, which facilitates the subsequent acquisition of image parameters of some target images with smaller imaging based on the monopole object image, thereby facilitating the subsequent improvement of the resolution of various target images with too small imaging.
[0050] S300: performing an alternating loss operation on the scene image parameters to obtain a focal loss state value.
[0051] In this embodiment, the scene image parameters are parameters of all target images in the monopolar object image, that is, in addition to the target images with large imaging under low resolution, the images with small imaging also appear in the monopolar object image and are converted into scene image parameters accordingly. In order to reduce the neglect of the target images with too small imaging, that is, to reduce the problem that the target images with too small imaging cannot be displayed and obtained under low resolution, the scene image parameters are converted into focal loss, that is, the focal loss state value, by performing alternating loss operation on the scene image parameters. The focal loss is the embodiment of the imaging loss situation of each target image during imaging. In this way, by obtaining the focal loss state value, it is convenient to clearly know the imaging focal loss situation of each target image on the monopolar object image in the future, so as to facilitate the subsequent adjustment of the imaging rate of the target image according to the focal loss situation, and then facilitate the subsequent improvement of the resolution of the monopolar object image, so that the target image with too small imaging can be imaged.
[0052] S400: performing a residual operation on the focal loss state value and a preset focal loss value to obtain a focal loss differential value.
[0053] In this embodiment, the preset focal loss value is a standard focal loss state value built into the system, that is, in the case of standard focal loss, a target image that is too small can also be clearly marked and displayed, and the corresponding focal loss at this time is the preset focal loss value. By performing a residual operation on the focal loss state value and the preset focal loss value, it is actually to judge the current focal loss state of the monopolar object image, detect the difference between the current focal loss of the monopolar object image and the standard focal loss, that is, to determine the difference between the current focal loss state of the monopolar object image and the standard focal loss state. Among them, the focal loss differential value is a reflection of the degree of difference between the current focal loss state of the monopolar object image and the standard focal loss state, which facilitates the subsequent adjustment of the focal loss of the monopolar object image to achieve the function of improving the resolution.
[0054] S500: Adjusting a focal loss adjustment factor according to the focal loss differential value so that the focal loss state value matches the preset focal loss value.
[0055] In this embodiment, the focus loss adjustment factor is an adjustable factor in the focus loss state value, and has the function of adjusting the focus loss state value. After the focus loss difference value is obtained, by judging the numerical value of the focus loss difference value, it is determined whether to adjust the focus loss adjustment factor, so as to match the focus loss state value with the preset focus loss value, so that the focus loss of each background image of the monopolar object image reaches the standard focus loss, thereby improving the imaging rate of the monopolar object image, and then improving the resolution of the monopolar object image, which is helpful to clearly display and mark the target that is too small in the monopolar object image.
[0056] In the above embodiment, a focus loss state value is obtained for the monopolar object image, and the focus loss state value is used to reflect the degree of resolution of the monopolar object image. By comparing the focus loss state value with a preset focus loss value, a focus loss differential value is obtained, which reflects the difference between the resolution of the current monopolar object image and the resolution of the clear image. Finally, the focus loss adjustment factor is adjusted according to the focus loss differential value, and the focus loss state value is effectively adjusted, so that the focus loss of the monopolar object image after imaging is reduced, thereby improving the imaging rate of the monopolar object image.
[0057] In one embodiment, the obtaining of scene parameters according to the monopolar object image includes: obtaining foreground image parameters according to the monopolar object image; calibrating the corresponding first classification value for the foreground image parameters. In this embodiment, the monopolar object image includes a foreground image and a background image, that is, each target image on the monopolar object image is divided into a foreground image and a background image, that is, each target sample on the monopolar object image is divided into a foreground sample and a background sample. Among them, the parameters of each target sample image in the foreground image are calibrated so that each foreground image parameter corresponding to each foreground target sample image has a first classification value, and the first classification value corresponds to the foreground classification type, that is, the first classification value is used to reflect the foreground classification, which is different from the background classification, and serves as a classification identifier to distinguish the foreground target sample image from the background target sample image, so as to facilitate the subsequent calculation of the focal loss of the foreground image according to the first classification value and the foreground image parameters.
[0058] Furthermore, the method of obtaining scene parameters according to the monopole object image further includes: obtaining background image parameters according to the monopole object image; and calibrating the corresponding second classification value for the background image parameters. In this embodiment, the monopole object image includes a foreground image and a background image, that is, each target image on the monopole object image is divided into a foreground image and a background image, that is, each target sample on the monopole object image is divided into a foreground sample and a background sample. Among them, the parameters of each target sample image in the background image are calibrated so that each background image parameter corresponding to each background target sample image has a second classification value, and the second classification value corresponds to the background classification type, that is, the second classification value is used to reflect the background classification, which is different from the foreground classification, and serves as a classification identifier to distinguish the background target sample image from the foreground target sample image, so as to facilitate the subsequent calculation of the focal loss of the background image according to the second classification value and the background image parameters.
[0059] In one of the embodiments, the alternating loss operation on the scene parameters to obtain the focal loss state value includes: performing cross-entropy loss processing on the scene parameters to obtain an entropy loss value and a corresponding classification probability. In this embodiment, the scene parameters include foreground image parameters and background image parameters, the foreground image parameters are image parameters corresponding to the foreground target in the monopolar object image, and the background image parameters are image parameters corresponding to the background target in the monopolar object image. Performing cross-entropy loss processing on the scene parameters is actually performing cross-entropy loss processing on the foreground image parameters and the background image parameters respectively, and obtaining the corresponding cross-entropy loss. In this way, by obtaining the cross-entropy loss of the monopolar object image, it is convenient to subsequently calculate the focal loss of the monopolar object image according to the entropy loss value, that is, the focal loss state value is obtained based on the entropy loss value.
[0060] Specifically, before calculating the focal loss state value, the cross entropy loss needs to be calculated. The corresponding formula in the cross entropy loss processing is as follows:
[0061]
[0062]
[0063] Where p is the probability of the sample image, y is the classification value of the sample image, for example, the first classification value and the second classification value, p t is the classification probability corresponding to the classified sample image, and CE is the entropy loss value of the sample image after cross entropy loss processing.
[0064] By performing cross entropy loss processing on the target image, that is, using a binary cross-tropic loss to calculate the entropy loss of the target image, wherein the foreground and background target images are classified by y, so that the foreground target image and the background target image have corresponding classification probabilities and entropy loss values, it is convenient to calculate the corresponding entropy loss values for the foreground target image and the background target image respectively, thereby facilitating the determination of the cross entropy loss of the foreground image and the background image, and then facilitating the subsequent calculation of the corresponding focal loss according to the entropy loss value of the cross entropy loss.
[0065] Furthermore, the scene parameters are subjected to cross-entropy loss processing to obtain entropy loss values and corresponding classification probabilities, and then further include: performing focal loss processing on the entropy loss values and the classification probabilities to obtain focal loss state values. In this embodiment, after obtaining the entropy loss value of the cross-entropy loss operation, the scene parameters are subjected to cross-entropy loss calculation to obtain entropy loss values and corresponding classification probabilities. In order to obtain an accurate focal loss state value, it is necessary to perform focal loss processing on the entropy loss value and the corresponding classification probability, that is, to perform focal loss calculation on the entropy loss value, that is, to perform focal loss processing on the output after the cross-entropy loss processing, so that the final focal loss state value corresponds to the focal loss of each scene, that is, the foreground focal loss and the background focal loss, so as to facilitate the subsequent calculation of the focal loss of the monopole object image.
[0066] The calculation formulas for foreground focus loss and background focus loss are as follows:
[0067]
[0068] Among them, L flis the focal loss state value, p is the probability of the sample image, γ is the focal loss adjustment factor, and y is the classification value of the sample image, for example, the first classification value and the second classification value. In this embodiment, the focal loss calculation method, the focal loss is to solve a target detection scene in a stage, in which there is an extremely unbalanced background, so the above calculation formula is introduced to calculate the focal loss, and the focal loss is introduced starting from the binary cross-tropism loss (i.e., cross entropy loss), and the classification of the foreground and background specified by y. The focal loss of the monopolar object image can be obtained through the above focal loss formula. For example, according to the above focal loss formula, it is integrated to obtain the loss value, that is, the foreground focal loss and the background focal loss are integrated together, so as to obtain the focal loss state value. This loss value is used to reflect the resolution of the monopolar object image, so that it is convenient to adjust the resolution of the monopolar object image according to this loss value, so that the resolution of the monopolar object image can be improved, so that the target image with too small imaging in the monopolar object image can be displayed and marked. Moreover, through the above-mentioned cross entropy loss processing and focal loss processing, the relative loss of well-classified sample images can be reduced, that is, by adjusting the focal loss adjustment factor, the focal loss is concentrated on the difficult sample images, thereby achieving the reduction of focal loss of well-classified sample images and effectively improving the resolution of monopole object images.
[0069] In one embodiment, the adjusting the focal loss adjustment factor according to the focal loss difference value comprises: detecting whether the focal loss difference value is greater than a preset difference value; when the focal loss difference value is greater than the preset difference value, increasing the focal loss adjustment factor. In this embodiment, the preset difference value is a judgment standard of the focal loss difference value, and the preset difference value is an allowable error range of the focal loss difference value, that is, the preset difference value is an allowable deviation of the difference between the focal loss state value and the preset focal loss value, that is, within the preset difference value, the focal loss difference value is allowed, and at this time, the difference between the focal loss of the monopolar object image and the standard focal loss is within the allowable deviation range. Comparing the focal loss difference value with the preset difference value is to judge the difference between the focal loss of the monopolar object image and the standard focal loss. When the focal loss difference value is greater than the preset difference value, it indicates that the difference between the current focal loss of the monopolar object image and the standard focal loss is large, that is, it indicates that the current focal loss of the monopolar object image is outside the allowable focal loss error range. In this way, the current focus loss of the monopolar object image is relatively large at this time. By adjusting the focus loss adjustment factor, that is, increasing the focus loss adjustment factor, according to the focus loss calculation formula, it can be known that after increasing the focus loss adjustment factor, the focus loss state value can be reduced, which is convenient for reducing the focus loss of the monopolar object image, improving the imaging rate of the monopolar object image, and thus improving the resolution of the monopolar object image.
[0070] In another embodiment, the detecting whether the focal loss difference value is greater than a preset difference value further includes: when the focal loss difference value is less than or equal to the preset difference value, obtaining and maintaining the current focal loss adjustment factor. At this time, the difference between the current focal loss of the monopolar object image and the standard focal loss is small, that is, the current focal loss of the monopolar object image is within the allowable focal loss error range, and the current focal loss of the monopolar object image is within the allowable focal loss interval, so that the current focal loss of the monopolar object image belongs to the standard focal loss range. At this time, the monopolar object image is sufficient to display and mark the target image that could not be imaged before, that is, the resolution of the monopolar object image is high enough to display each target in the monopolar object image.
[0071] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0072] The present application also provides a monopolar object image imaging device, which is implemented by the monopolar object image imaging method described in any of the above embodiments. In one embodiment, the monopolar object image imaging device has a functional module corresponding to each step of the monopolar object image imaging method. The monopolar object image imaging device includes an image acquisition module, an image conversion module, a first processing module, a second processing module and an adjustment processing module, wherein:
[0073] An image acquisition module, used for acquiring a monopolar object image;
[0074] An image conversion module, used for acquiring scene parameters according to the monopole object image;
[0075] A first processing module is used to perform an alternating loss operation on the scene image parameters to obtain a focal loss state value;
[0076] A second processing module is used to perform a residual operation on the focal loss state value and a preset focal loss value to obtain a focal loss differential value;
[0077] An adjustment processing module is used to adjust the focal loss adjustment factor according to the focal loss differential value so that the focal loss state value matches the preset focal loss value.
[0078] In this embodiment, the first processing module obtains a focus loss state value for the monopolar object image, and the focus loss state value is used to reflect the resolution level of the monopolar object image. The second processing module obtains a focus loss difference value by comparing the focus loss state value with a preset focus loss value, which reflects the difference between the resolution of the current monopolar object image and the resolution of the clear image. Finally, the adjustment processing module adjusts the focus loss adjustment factor according to the focus loss difference value, effectively adjusting the focus loss state value, so that the focus loss of the monopolar object image after imaging is reduced, thereby improving the imaging rate of the monopolar object image.
[0079] In one embodiment, the image conversion module is further used to obtain foreground image parameters according to the monopolar object image; and calibrate the corresponding first classification value for the foreground image parameters. In this embodiment, the monopolar object image obtained by the image conversion module includes a foreground image and a background image, that is, the image conversion module divides each target image on the monopolar object image into a foreground image and a background image, that is, each target sample on the monopolar object image is divided into a foreground sample and a background sample. Among them, the image conversion module calibrates the parameters of each target sample image in the foreground image, so that each foreground image parameter corresponding to each foreground target sample image has a first classification value, and the first classification value corresponds to the foreground classification type, that is, the first classification value is used to reflect the foreground classification, which is different from the background classification, and serves as a classification identifier to distinguish the foreground target sample image from the background target sample image, so as to facilitate the subsequent calculation of the focal loss of the foreground image according to the first classification value and the foreground image parameter.
[0080] Furthermore, the image conversion module is also used to obtain background image parameters according to the monopole object image; and calibrate the corresponding second classification value for the background image parameters. In this embodiment, the monopole object image obtained by the image conversion module includes a foreground image and a background image, that is, each target image on the monopole object image is divided into a foreground image and a background image, that is, each target sample on the monopole object image is divided into a foreground sample and a background sample. Among them, the image conversion module calibrates the parameters of each target sample image in the background image, so that each background image parameter corresponding to each background target sample image has a second classification value, and the second classification value corresponds to the background classification type, that is, the second classification value is used to reflect the background classification, which is different from the foreground classification, and serves as a classification identifier to distinguish the background target sample image from the foreground target sample image, so as to facilitate the subsequent calculation of the focal loss of the background image according to the second classification value and the background image parameters.
[0081] In one of the embodiments, the first processing module is used to perform cross entropy loss processing on the scene parameters to obtain an entropy loss value and a corresponding classification probability. In this embodiment, the scene parameters include foreground image parameters and background image parameters, the foreground image parameters are image parameters corresponding to the foreground target in the monopolar object image, and the background image parameters are image parameters corresponding to the background target in the monopolar object image. The first processing module performs cross entropy loss processing on the scene parameters, which actually means that the first processing module performs cross entropy loss processing on the foreground image parameters and the background image parameters respectively, and obtains the corresponding cross entropy loss. In this way, the first processing module obtains the cross entropy loss of the monopolar object image, which facilitates the subsequent calculation of the focal loss of the monopolar object image according to the entropy loss value, that is, the focal loss state value is obtained based on the entropy loss value.
[0082] Specifically, before calculating the focal loss state value, the cross entropy loss needs to be calculated. The corresponding formula in the cross entropy loss processing is as follows:
[0083]
[0084]
[0085] Where p is the probability of the sample image, y is the classification value of the sample image, for example, the first classification value and the second classification value, p t is the classification probability corresponding to the classified sample image, and CE is the entropy loss value of the sample image after cross entropy loss processing.
[0086] By performing cross entropy loss processing on the target image, that is, using a binary cross-tropic loss to calculate the entropy loss of the target image, wherein the foreground and background target images are classified by y, so that the foreground target image and the background target image have corresponding classification probabilities and entropy loss values, it is convenient to calculate the corresponding entropy loss values for the foreground target image and the background target image respectively, thereby facilitating the determination of the cross entropy loss of the foreground image and the background image, and then facilitating the subsequent calculation of the corresponding focal loss according to the entropy loss value of the cross entropy loss.
[0087] Furthermore, the first processing module is also used to perform a focus loss process on the entropy loss value and the classification probability to obtain a focus loss state value. In this embodiment, after obtaining the entropy loss value of the cross-entropy loss operation, the first processing module performs a cross-entropy loss calculation on the scene parameters to obtain the entropy loss value and the corresponding classification probability. In order to obtain an accurate focus loss state value, the first processing module needs to perform a focus loss process on the entropy loss value and the corresponding classification probability, that is, perform a focus loss calculation on the entropy loss value, that is, perform a focus loss process on the output after the cross-entropy loss processing, so that the focus loss state value finally obtained by the first processing module corresponds to the focus loss of each scene, that is, the foreground focus loss and the background focus loss, so as to facilitate the subsequent calculation of the focus loss of the monopole object image.
[0088] The calculation formulas for foreground focus loss and background focus loss are as follows:
[0089]
[0090] Among them, L fl is the focal loss state value, p is the probability of the sample image, γ is the focal loss adjustment factor, and y is the classification value of the sample image, for example, the first classification value and the second classification value. In this embodiment, the focal loss calculation method, the focal loss is to solve a target detection scene in a stage, in which there is an extremely unbalanced background, so the above calculation formula is introduced to calculate the focal loss, and the focal loss is introduced starting from the binary cross-tropism loss (i.e., cross entropy loss), and the classification of the foreground and background specified by y. The focal loss of the monopolar object image can be obtained through the above focal loss formula. For example, according to the above focal loss formula, it is integrated to obtain the loss value, that is, the foreground focal loss and the background focal loss are integrated together, so as to obtain the focal loss state value. This loss value is used to reflect the resolution of the monopolar object image, so that it is convenient to adjust the resolution of the monopolar object image according to this loss value, so that the resolution of the monopolar object image can be improved, so that the target image with too small imaging in the monopolar object image can be displayed and marked. Moreover, through the above-mentioned cross entropy loss processing and focal loss processing, the relative loss of well-classified sample images can be reduced, that is, by adjusting the focal loss adjustment factor, the focal loss is concentrated on the difficult sample images, thereby achieving the reduction of focal loss of well-classified sample images and effectively improving the resolution of monopole object images.
[0091] In one embodiment, the adjustment processing module is used to detect whether the focal loss difference value is greater than a preset difference value; when the focal loss difference value is greater than the preset difference value, the focal loss adjustment factor is increased. In this embodiment, the preset difference value in the adjustment processing module is a judgment standard for the focal loss difference value, and the preset difference value is an allowable error range of the focal loss difference value, that is, the preset difference value is an allowable deviation of the difference between the focal loss state value and the preset focal loss value, that is, within the preset difference value, the focal loss difference value is allowed, and at this time, the difference between the focal loss of the monopolar object image and the standard focal loss is within the allowable deviation range. The adjustment processing module compares the focal loss difference value with the preset difference value, that is, judges the difference between the focal loss of the monopolar object image and the standard focal loss. When the focal loss difference value is greater than the preset difference value, it indicates that the difference between the current focal loss of the monopolar object image and the standard focal loss is large, that is, it indicates that the current focal loss of the monopolar object image is outside the allowable focal loss error range. In this way, at this time, the adjustment processing module determines that the current focus loss of the monopolar object image is relatively large, and adjusts the focus loss adjustment factor, that is, increases the focus loss adjustment factor. According to the focus loss calculation formula, after increasing the focus loss adjustment factor, the focus loss state value can be reduced, which is convenient for reducing the focus loss of the monopolar object image, improving the imaging rate of the monopolar object image, and thus improving the resolution of the monopolar object image.
[0092] In another embodiment, the adjustment processing module is further used to obtain and maintain the current focus loss adjustment factor when the focus loss difference value is less than or equal to the preset difference value. At this time, the adjustment processing module detects that the difference between the current focus loss of the monopolar object image and the standard focus loss is small, that is, the current focus loss of the monopolar object image is within the allowable focus loss error range, and the current focus loss of the monopolar object image is within the allowable focus loss interval, so that the current focus loss of the monopolar object image belongs to the standard focus loss range. At this time, the monopolar object image is sufficient to display and mark the target image that could not be imaged before, that is, at this time, the resolution of the monopolar object image is high enough to display each target in the monopolar object image.
[0093] For the specific definition of the monopolar object image imaging device, please refer to the definition of the monopolar object image imaging method above, which will not be repeated here. Each module in the above-mentioned monopolar object image imaging device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0094] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 2 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store focal loss value data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a monopolar object imaging method is implemented.
[0095] Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0096] In one of the embodiments, the present application further provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0097] In one of the embodiments, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0098] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for imaging a monopolar object, It is characterized in that include: Acquire a monopolar object image, wherein the monopolar object image includes a foreground image and a background image; Acquiring scene parameters according to the monopole object image; Performing an alternating loss operation on the scene image parameters to obtain a focal loss state value; Performing a residual operation on the focal loss state value and a preset focal loss value to obtain a focal loss differential value; adjusting a focal loss adjustment factor according to the focal loss differential value so that the focal loss state value matches the preset focal loss value; Wherein, acquiring scene parameters according to the monopole object image includes: Acquiring foreground image parameters according to the monopole object image; Calibrate a first classification value corresponding to the foreground image parameter; And, the acquiring of scene parameters according to the monopole object image further includes: Acquiring background image parameters according to the monopole object image; The background image parameter is calibrated to a corresponding second classification value.
2. The monopolar object imaging method according to claim 1, It is characterized in that The step of performing an alternating loss operation on the scene image parameters to obtain a focal loss state value includes: The scene parameters are subjected to cross entropy loss processing to obtain an entropy loss value and a corresponding classification probability.
3. The monopolar object imaging method according to claim 2, It is characterized in that The cross entropy loss processing is performed on the scene parameters to obtain an entropy loss value and a corresponding classification probability, and then further includes: Performing focal loss processing on the entropy loss value and the classification probability to obtain a focal loss state value.
4. The monopolar object imaging method according to any one of claims 1 to 3, It is characterized in that The adjusting the focal loss adjustment factor according to the focal loss difference value includes: Detecting whether the focal loss difference value is greater than a preset difference value; When the focal loss difference value is greater than the preset difference value, the focal loss adjustment factor is increased.
5. The monopolar object imaging method according to claim 4, It is characterized in that The detecting whether the focal loss difference value is greater than a preset difference value further includes: When the focal loss difference value is less than or equal to the preset difference value, the current focal loss adjustment factor is obtained and maintained.
6. A monopolar object imaging device, It is characterized in that The device comprises: An image acquisition module, used for acquiring a monopolar object image, wherein the monopolar object image includes a foreground image and a background image; An image conversion module, used to obtain scene image parameters according to the monopole object image, and also used to obtain foreground image parameters according to the monopole object image; calibrate the corresponding first classification value for the foreground image parameters; and obtain background image parameters according to the monopole object image; calibrate the corresponding second classification value for the background image parameters; A first processing module is used to perform an alternating loss operation on the scene image parameters to obtain a focal loss state value; A second processing module is used to perform a residual operation on the focal loss state value and a preset focal loss value to obtain a focal loss differential value; An adjustment processing module is used to adjust the focal loss adjustment factor according to the focal loss differential value so that the focal loss state value matches the preset focal loss value.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Image processing method and device, computer readable storage medium, and computer equipment
CN108764370A
Information search method, device and equipment and storage medium
CN111368525A