Image detection method, device, electronic device, storage medium and attendance machine
By performing multi-scale feature extraction and difference feature extraction on images, the problem of inaccurate anchor point detection is solved and the accuracy of target detection is improved.
Patent Information
- Application Number
- CN202011035623.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-27
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2040-09-27
AI Technical Summary
The existing target detection model is not accurate enough in anchor point detection, resulting in inaccurate target detection results.
By performing multi-scale feature extraction on the image to be detected, aggregating the first aggregated features, and performing feature extraction on the difference between positive anchor points and negative anchor points, incremental features are obtained to improve the accuracy of anchor point detection.
The detection accuracy of positive and negative anchor points is improved, and the accuracy of target detection is improved.
Smart Images

Figure CN114359124B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to an image detection method, device, electronic equipment, computer storage medium, and an attendance machine. Background Art
[0002] With the development of computer vision technology, object detection—the use of computer image processing techniques to detect objects in images—is becoming increasingly widespread. Object detection effectively identifies objects in images for appropriate processing. Currently, object detection is often achieved through object detection models.
[0003] An object detection model is a model that detects the target object region in an input image and outputs the target object's category in that region. Current object detection models include one-stage and two-stage models. One-stage models include the Fully Convolutional One-Stage Object Detection (FCOS), You Only Look Once (YOLO), Single Shot MultiBox Detector (SSD), and Retina-Net. Two-stage models include the Region-CNN (R-CNN) and Fast R-CNN.
[0004] When using target detection models such as those described above to perform target detection, anchors are required to predict the target object, and the target detection result is ultimately determined based on the prediction results. The anchors include positive and negative anchors learned through training on positive and negative anchor samples. However, in existing target detection processes, the detection of positive and negative anchors is often inaccurate, making it impossible to accurately identify the target object, resulting in inaccurate target detection results. Summary of the Invention
[0005] In view of this, an embodiment of the present invention provides an image detection solution to at least partially solve the above problems.
[0006] According to a first aspect of an embodiment of the present invention, an image detection method is provided, including: aggregating multi-scale features corresponding to an image to be detected to obtain a first aggregated feature; performing feature extraction on the first aggregated feature to obtain a difference between a positive anchor point and a negative anchor point to obtain a corresponding incremental feature; and obtaining a detection result of the image to be detected based on the first aggregated feature and the incremental feature.
[0007] According to a second aspect of an embodiment of the present invention, another image detection method is provided, including: obtaining an image detection request, wherein the image detection request carries information of an image to be detected; using an image detection method, performing image detection on the image to be detected requested by the image detection request, wherein the image detection method is the image detection method as described in any one of claims 1 to 14.
[0008] According to a third aspect of an embodiment of the present invention, an image detection device is provided, including: a first acquisition module, used to aggregate multi-scale features corresponding to an image to be detected to obtain a first aggregated feature; a second acquisition module, used to perform feature extraction on the first aggregated feature to obtain a difference between a positive anchor point and a negative anchor point, to obtain a corresponding incremental feature; and a third acquisition module, used to obtain a detection result of the image to be detected based on the first aggregated feature and the incremental feature.
[0009] According to a fourth aspect of an embodiment of the present invention, an electronic device is provided, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the image detection method described in the first aspect.
[0010] According to a fifth aspect of the embodiments of the present invention, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the image detection method as described in the first aspect is implemented.
[0011] According to a sixth aspect of an embodiment of the present invention, there is provided an attendance machine, which comprises at least: a biometric information collection component, a processor, and a memory; wherein the biometric information collection component is used to collect human biometric information and generate a biometric information image; the processor is used to obtain the biometric information image, perform multi-scale feature extraction on the biometric information image and obtain corresponding multi-scale features; aggregate the multi-scale features to obtain a first aggregate feature; perform feature extraction on the first aggregate feature to obtain a difference between a positive anchor point and a negative anchor point to obtain a corresponding incremental feature; obtain a biometric information verification result of the biometric information image based on the first aggregate feature and the incremental feature; generate an attendance record based on the biometric information verification result, and send the attendance record to the memory; the memory is used to store the attendance record.
[0012] According to the image detection solution provided by an embodiment of the present invention, based on the multi-scale features obtained by multi-scale feature extraction of the image to be detected, the multi-scale features are first aggregated to obtain a first aggregate feature; then, the first aggregate feature is subjected to feature extraction again, that is, the first aggregate feature is subjected to feature extraction for obtaining the difference between the positive anchor point and the negative anchor point, so as to obtain a feature that characterizes the difference between the positive anchor point and the negative anchor point, namely an incremental feature; and then, based on the first aggregate feature and the incremental feature, a detection result of the image to be detected is obtained. Among them, the incremental feature carries effective and rich difference information between the positive anchor point and the negative anchor point, so that the positive anchor point and the negative anchor point can be effectively identified and distinguished, thereby improving the accuracy of the detection of the positive anchor point and the negative anchor point, and thus improving the accuracy of target detection in the image to be detected. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0014] Figure 1A This is a flowchart of the steps of an image detection method according to the first embodiment of the present invention;
[0015] Figure 1B for Figure 1A A schematic diagram of an example scenario in the illustrated embodiment;
[0016] Figure 2A This is a flowchart of the steps of an image detection method according to the second embodiment of the present invention;
[0017] Figure 2B for Figure 2A A schematic diagram of a target detection model structure in the illustrated embodiment;
[0018] Figure 2C for Figure 2A A schematic diagram of obtaining fine-grained features through a nearest neighbor interpolation algorithm in the illustrated embodiment;
[0019] Figure 3A This is a flowchart of an image detection method according to Embodiment 3 of the present invention;
[0020] Figure 3B for Figure 3A A schematic diagram of an example scenario in the illustrated embodiment;
[0021] Figure 4 This is a structural block diagram of an image detection device according to a fourth embodiment of the present invention;
[0022] Figure 5 This is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention;
[0023] Figure 6 2 is a structural diagram of an attendance machine according to embodiment 6 of the present invention. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in the embodiments of the present invention should fall within the scope of protection of the embodiments of the present invention.
[0025] The specific implementation of the embodiment of the present invention is further described below with reference to the accompanying drawings of the embodiment of the present invention.
[0026] Example 1
[0027] Reference Figure 1A , shows a flowchart of the steps of an image detection method according to embodiment 1 of the present invention.
[0028] The image detection method of this embodiment includes the following steps:
[0029] Step S102: Aggregate the multi-scale features corresponding to the image to be detected to obtain a first aggregated feature.
[0030] In embodiments of the present invention, the image to be detected can be any appropriate image containing an appropriate target object, such as a person or object. Multi-scale features corresponding to the image to be detected can be obtained by performing multi-level feature extraction on the image to be detected at different feature extraction levels. Optionally, multi-scale feature extraction can be performed using an FPN (Feature Pyramid Network) structure.
[0031] After obtaining the multi-scale features corresponding to the image to be detected, they can be aggregated, such as by stacking or splicing, to obtain a first aggregated feature.
[0032] Step S104: performing feature extraction on the first aggregated features to obtain the difference between the positive anchor points and the negative anchor points, and obtaining corresponding incremental features.
[0033] In this step, feature extraction is performed again on the first aggregated features. However, unlike conventional feature extraction, features that can characterize the differences between positive anchor points and negative anchor points in the image to be detected are extracted in this step and used as incremental features.
[0034] Among them, the anchor point is also called anchor. When the feature map uses the sliding window operation mode, the mapping point of the center of the current sliding window in the original image pixel space is called anchor. In practical applications, an anchor box based on anchor points can also be used. The anchor box is formed by multiple anchor points. For a positive anchor box, the anchor points therein are all positive anchor points; correspondingly, for a negative anchor box, the anchor points therein are all negative anchor points. Although at a more macroscopic level, different objects in the image to be detected can be predicted and labeled by the anchor box, its essence is still to predict and label the pixel points of different objects in the image through the anchor points. Therefore, in the embodiments of the present invention, anchor points are used as examples for explanation.
[0035] Through this step, effective features containing the differences between positive anchor points and negative anchor points, namely incremental features, can be obtained, so that positive and negative anchor points can be effectively classified by a classifier in the future to obtain more accurate classification results.
[0036] Step S106: Obtain a detection result of the image to be detected based on the first aggregated features and the incremental features.
[0037] The first aggregated features contain image features of different scales, while the incremental features effectively characterize the differences between positive and negative anchor points. Based on these two features, accurate detection of the image to be detected can be performed to obtain detection results, such as the target object in the image to be detected. For example, these two features can be input into the corresponding classifier for classification and recognition, thereby determining the target object in the image to be detected, which is calibrated by the positive anchor point.
[0038] An example scenario of the above process is as follows Figure 1B As shown, the image to be detected is input into the target detection model, and the backbone network of the target detection model performs multi-level convolution processing and FPN structure performs feature extraction processing to obtain feature maps corresponding to multiple levels P3-P7, which are set as F3-F7. Furthermore, feature aggregation is performed based on these feature maps to obtain the aggregated feature A1 (i.e., the first aggregated feature). Feature A1 is feature extracted again through multiple convolution layers for extracting the difference between positive anchor points and negative anchor points to obtain feature A2 (i.e., incremental feature) that characterizes the difference between positive anchor points and negative anchor points. Then, feature A1 and feature A2 are aggregated to obtain the aggregated feature A3 (i.e., the second aggregated feature). Feature A3 is input into the classifier to obtain the classification result for the object in the image to be detected, and the target object in the image to be detected is determined according to the classification result, that is, the detection result of the image to be detected is obtained, which is the "tree" framed in the dotted box in this example.
[0039] It can be seen that through this embodiment, based on the multi-scale features obtained by multi-scale feature extraction of the image to be detected, the multi-scale features are first aggregated to obtain a first aggregate feature; then, feature extraction is performed on the first aggregate feature again, that is, feature extraction is performed on the first aggregate feature to obtain the difference between the positive anchor point and the negative anchor point, so as to obtain a feature that characterizes the difference between the positive anchor point and the negative anchor point, namely, an incremental feature; then, based on the first aggregate feature and the incremental feature, the detection result of the image to be detected is obtained. Among them, the incremental feature carries effective and rich difference information between the positive anchor point and the negative anchor point, so that the positive anchor point and the negative anchor point can be effectively identified and distinguished, thereby improving the accuracy of detection of the positive anchor point and the negative anchor point, and thus improving the accuracy of target detection in the image to be detected.
[0040] The image detection method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a PC, and even a high-performance mobile terminal.
[0041] Example 2
[0042] Reference Figure 2A , shows a flowchart of the steps of an image detection method according to embodiment 2 of the present invention.
[0043] In this embodiment, the training process of the target detection model is first described, and then image detection is performed based on the trained target detection model.
[0044] like Figure 2B As shown in the figure, the object detection model in this embodiment includes: a backbone network, a feature enhancement part, a multi-scale feature extraction part, a positive anchor point and negative anchor point difference feature extraction part, and a classifier part. The backbone network part can be any appropriate network capable of image feature extraction, including but not limited to ResNET network, SOTA network, etc.; the feature enhancement part includes a fine-grained feature extraction part, a contextual information enhancement part, and a global feature extraction part; and the classifier part includes a main classifier and an auxiliary classifier.
[0045] Based on this, the image detection method of this embodiment includes the following steps:
[0046] Step S202: Using sample images to train the target detection model.
[0047] The sample image may be any appropriate image, which is not limited in the embodiment of the present invention.
[0048] Furthermore, it should be noted that the feature enhancement portion in this embodiment is optional. In practical applications, the features output by the backbone network can be directly input into the multi-scale feature extraction portion for multi-scale feature extraction. This embodiment uses the feature enhancement portion as an example to illustrate the training of the object detection model.
[0049] First, the sample image is input into the target detection model, and image features are extracted through its backbone network. Taking ResNET as the backbone network part as an example, ResNET uses multiple blocks to extract features. In the traditional way, it uses a feature extraction method of stacking blocks, so that the features output by the last block have richer semantic information than the features output by other blocks. However, this method is not conducive to extracting detailed features of the image. To this end, in this embodiment, the features output by each block are processed. For example, when the target detection model includes a feature enhancement part, feature enhancement processing is performed on the output of each block to perform feature extraction step by step, so as to effectively extract fine-grained features of the sample image and make up for the gap between high-level features and multi-scale feature representations.
[0050] Specifically, after each block in the last level of the backbone network, there are fine-grained feature extraction and context information enhancement parts. Then, the features processed by each context information enhancement part will be fused, and the fused features will be input into the global feature extraction part. After being processed by the global feature extraction part, the global features will be generated and handed over to the subsequent multi-scale feature extraction part for processing. For example, Figure 2B As shown in , it is assumed that the last level block of ResNET includes 4 blocks, and each block is followed by a FFEM module (Fine-grained Feature Enhancement Module) to extract fine-grained features of the sample image. Among them, fine-grained features are features with finer granularity compared to ordinary image features such as semantic features. Compared with semantic-level features, the information expressed by fine-grained features is more refined, and the difference in information expressed between features is more subtle. In specific implementation, the fine-grained feature extraction of the sample image can be achieved through the nearest neighbor interpolation method. Through the nearest neighbor interpolation method, the extraction of fine-grained features can be achieved at a lower cost and faster speed. However, it is not limited to this, and other methods that can achieve fine-grained feature extraction are also within the protection scope of the embodiments of the present invention.
[0051] Furthermore, each FFEM module can be followed by a contextual information enhancement part, such as Figure 2BThe RCM module (Residual Context Module) shown in the figure is used to enhance the fine-grained features. However, it should be noted that the RCM module is an optional module and can be omitted in actual applications. By setting the RCM module, block-level context information enhancement can be achieved, thereby reactivating the representation of each block; and when performing subsequent global feature extraction, it is necessary to gradually combine the block-level residual context information, so that the connection between the context information representations of multiple blocks can be established, which helps to clarify the role of each block in generating residual context information.
[0052] Then, as mentioned above, the block-level residual context information is gradually combined to obtain the fused context information, and then the global feature extraction part is performed, such as Figure 2B The GCM module (Global Context Module, global feature enhancement module) in the image processing module performs global feature extraction to obtain the global features of the sample image.
[0053] Through the above process, feature enhancement from fine-grained → local → global is achieved.
[0054] Then, the global features obtained by feature enhancement are input into the multi-scale feature extraction part to perform multi-scale feature extraction. Figure 2B As shown in the figure, the global features are input into the Feature Pyramid Network (FPN) to obtain multi-scale features p2, p3, p4, p5, p6, and p7 corresponding to multiple levels.
[0055] Then, the multi-scale features are aggregated to generate a first aggregate feature. For example, the multi-scale features p2, p3, p4, p5, p6, and p7 can be concatenated to obtain an aggregate feature p_a.
[0056] The first aggregated features are then input into the positive anchor point and negative anchor point difference feature extraction part, which can be implemented as multiple convolutional layers, for example, two 3x3 convolutional layers. Each convolutional layer has 256 channels and 1 channel, where 256 channels are used to generate feature maps that distinguish difficult positive anchor points (positive anchor points that are not easy to detect or identify) and negative anchor points, and 1 channel is used to generate feature maps for classification (this channel does not occupy computational cost in the inference stage). During the training stage, the target detection model can perform backpropagation training based on the classification results of the classifier part, so that the positive anchor point and negative anchor point difference feature extraction part has the function of extracting the difference between positive anchor points and negative anchor points. For example, Figure 2BIn the process, the first aggregated feature, such as feature p_a, is input into the positive anchor point and negative anchor point difference feature extraction part, which performs feature extraction again to generate incremental features such as feature f_i for characterizing the difference between the positive anchor point and the negative anchor point.
[0057] Next, the incremental feature f_i can be combined with the first aggregate feature p_a to generate the second aggregate feature f_m. Combining f_i with p_a can encode the difference between the positive and negative anchor points into p_a, and the resulting f_m can effectively represent the difference.
[0058] Following the positive and negative anchor point difference feature extraction phase, the classifier phase is implemented. This phase consists of a primary classifier and an auxiliary classifier. The primary classifier primarily performs image feature classification, while the auxiliary classifier primarily performs positive and negative anchor point classification, guiding the difference learning phase of the positive and negative anchor point difference feature extraction phase. During the training phase, both classifiers perform feature processing and output; during the inference phase, the primary classifier can be used directly for classification.
[0059] The classifier part can be set in two ways, one is called an explicit way and the other is called an implicit way. In practical applications, those skilled in the art can use either one according to actual needs.
[0060] In the explicit approach, f_m is input into the main classifier and f_i is input into the auxiliary classifier. The main classifier outputs the first position of the difficult positive anchor point, the second position of the other positive anchor points except the difficult positive anchor point, and the third position of the negative anchor point.
[0061] In order to better learn the difference between positive and negative anchors, a dynamic difference label is set during the training phase. That is, the first position of the difficult positive anchor is designated as a positive sample (i.e., positive sample labeling), the third position of the negative anchor is designated as a negative sample (i.e., negative sample labeling), and the second position of the positive anchors other than the difficult positive anchor is designated as an ignored sample (i.e., ignored sample labeling). Using this dynamic difference label as a supervisory label, the auxiliary classifier can be trained to accurately classify and identify positive and negative anchors based on f_i to obtain classification results. Based on its classification results, the target detection module is backpropagated to train, especially the positive and negative anchor difference feature extraction part in the target detection model, so that its output feature map contains effective features that can distinguish positive anchors (including difficult positive anchors) from negative anchors.
[0062] In one feasible method, the first position, the second position and the third position in the classification results output by the main classifier can be masked; based on the classification results output by the masked main classifier and the classification results of the auxiliary classifier, the positive anchor point and negative anchor point difference feature extraction part in the target detection model is trained.
[0063] That is, based on the aforementioned multi-scale feature extraction process, the multi-scale feature extraction component performs multi-scale feature extraction on the sample image to obtain corresponding multi-scale sample features; the multi-scale sample features are aggregated to obtain a first aggregated sample feature; the first aggregated sample feature is subjected to feature extraction for obtaining the difference between positive and negative anchor points to obtain corresponding incremental sample features; a second aggregated sample feature is obtained based on the first aggregated sample feature and the incremental sample feature; then, in an explicit manner, the second aggregated sample feature is input into a primary classifier and the incremental sample feature is input into an auxiliary classifier; and the object detection model is trained based on the classification results of the primary and auxiliary classifiers. In this way, the positive and negative anchor point difference feature extraction component can quickly and efficiently learn the difference between positive and negative anchor points.
[0064] In the implicit approach, f_m is input to the main classifier, and p_a is input to the auxiliary classifier. Similar to the explicit approach, the main classifier outputs the first position of the difficult positive anchor, the second position of all positive anchors other than the difficult positive anchor, and the third position of the negative anchor. This implicit approach not only allows the difference feature extraction between positive and negative anchors to quickly and efficiently learn the differences between positive and negative anchors, but also avoids the additional computational overhead of the inference phase.
[0065] Similar to the explicit method, dynamic difference labels are used to annotate positive samples, negative samples, and ignored samples at each position of the main classifier's output, and then the auxiliary classifier is trained with the labeled results as supervision labels. The target detection model is trained by backpropagation based on the classification results of the auxiliary classifier, especially the positive anchor and negative anchor difference feature extraction part of the target detection model.
[0066] In one feasible approach, the first, second, and third positions in the classification results output by the main classifier can be masked. The positive and negative anchor point difference feature extraction component of the object detection model is trained based on the masked classification results output by the main classifier and the classification results of the auxiliary classifier. This allows the positive and negative anchor point difference feature extraction component to more easily learn the differences between positive and negative anchor points.
[0067] That is, based on the aforementioned multi-scale feature extraction part, multi-scale feature extraction is performed on the sample image to obtain corresponding multi-scale sample features; the multi-scale sample features are aggregated to obtain first aggregated sample features; feature extraction for obtaining the difference between positive anchor points and negative anchor points is performed on the first aggregated sample features to obtain corresponding incremental sample features; based on the first aggregated sample features and the incremental sample features, a second aggregated sample feature is obtained; and then, in an implicit manner, the second aggregated sample features are input into the main classifier, and the first aggregated sample features are input into the auxiliary classifier; based on the classification results of the main classifier and the classification results of the auxiliary classifier, the target detection model is trained.
[0068] For other parts of the target detection model, they can be trained by combining the classification results of the main classifier and the auxiliary classifier.
[0069] The trained target detection model can not only enhance the image features of the sample image, especially the fine-grained features, but also effectively detect and identify positive and negative anchor points, especially difficult positive anchor points.
[0070] Next, we will explain the process of performing image detection using the trained object detection model.
[0071] Step S204: extract fine-grained features from the image to be detected to obtain corresponding fine-grained features.
[0072] The image to be detected may be any appropriate image containing a target object, and the embodiment of the present invention does not impose any limitation on this.
[0073] As mentioned above, the image to be detected can be input into the object detection model. The backbone network first performs feature extraction, and then the feature enhancement part performs feature enhancement based on the extracted features. In this step, the fine-grained feature extraction part of the feature enhancement part first performs fine-grained feature extraction to obtain fine-grained features of the image to be detected.
[0074] In this embodiment, if the backbone network includes multiple feature extraction blocks, fine-grained feature extraction is performed on the features output by each block. That is, for each of the multiple feature extraction levels of the image to be detected, fine-grained feature extraction is performed based on the image features output by each level to obtain fine-grained features corresponding to each level.
[0075] In one feasible approach, fine-grained features can be extracted from the image to be detected using a nearest neighbor interpolation algorithm to obtain corresponding fine-grained features.
[0076] Since the nearest neighbor interpolation algorithm has the ability to obtain fine-grained feature representation, the fine-grained feature extraction part can be implemented accordingly. A schematic diagram of obtaining fine-grained features through the nearest neighbor interpolation algorithm is as follows Figure 2C As shown, Figure 2C Taking the pixel in the lower right corner as an example, it can be seen from the figure that the nearest neighbor interpolation algorithm copies the features of each pixel in the feature map into 4 copies, and then performs subsequent processing of the feature enhancement part. Therefore, when the target detection model is trained by back propagation, each pixel will include fine-grained feature representation (such as Figure 2C (shown in the upper right corner). Much better than conventional methods (such as Figure 2C The lower right side of the middle diagram can better express the detailed features of the image.
[0077] Step S206: Obtaining global features of the image to be detected based on the fine-grained features.
[0078] If the context information enhancement part is not set in the feature enhancement part of the target detection model, after obtaining the fine-grained features corresponding to each block and fusing them, the global feature extraction can be directly performed to obtain the corresponding global features.
[0079] If the feature enhancement part of the target detection model is provided with a context information enhancement part, the context information enhancement can be performed on the fine-grained features to obtain the context information corresponding to the fine-grained features; based on the context information, the global features of the image to be detected are extracted to obtain the global features of the image to be detected.
[0080] from Figure 2B As can be seen in the figure, each FFEM is followed by an RCM to enhance block-level contextual information, thereby reactivating the feature representation of each block. Furthermore, by gradually combining block-level residual contextual information, connections are established between the contextual information of multiple blocks, clarifying the role of each block in generating residual contextual information. After fusion, these contextual information is passed to the subsequent global feature extraction process. In other words, contextual information is enhanced for the fine-grained features corresponding to each level, obtaining contextual information corresponding to the fine-grained features at each level.
[0081] In one feasible manner, obtaining the global features of the image to be detected may include: obtaining initial global features of the image to be detected; and obtaining the global features of the image to be detected based on the feature mean of the initial global features. For example, the global features may be obtained by global average pooling.
[0082] It can be seen from the above process that in this embodiment, context information fusion is performed on multiple feature extraction levels based on the context information corresponding to the fine-grained features of each level; global feature extraction of the image to be detected is performed based on the fusion results to obtain the global features of the image to be detected.
[0083] Step S208: Based on the global features, multi-scale feature extraction is performed on the image to be detected to obtain corresponding multi-scale features.
[0084] For example, as mentioned above, multi-scale feature extraction can be performed through FPN in the target detection model to obtain corresponding multi-scale features p2, p3, p4, p5, p6, and p7.
[0085] Step S210: Aggregate the multi-scale features to obtain a first aggregated feature.
[0086] For example, multi-scale features p2, p3, p4, p5, p6, and p7 are connected to obtain the first aggregated feature p_a.
[0087] Step S212: performing feature extraction on the first aggregated features to obtain the difference between the positive anchor point and the negative anchor point, and obtaining the corresponding incremental features.
[0088] For example, the first aggregated feature p_a is input into the positive anchor point and negative anchor point difference feature extraction part in the target detection model to obtain the incremental feature f_i.
[0089] Step S214: obtaining a second aggregate feature based on the incremental feature and the first aggregate feature; inputting the second aggregate feature into the main classifier to obtain a detection result of the image to be detected.
[0090] For example, the first aggregate feature and the incremental feature are added together to obtain the second aggregate feature, such as f_m=p_a+f_i.
[0091] As previously mentioned, during the training phase of the target detection model, the training results of the main and auxiliary classifiers are used to train the difference feature extraction portion of the positive and negative anchor points. The training parameters are adjusted to enable effective difference feature extraction. Because the input data of the main classifier comes from the difference feature extraction portion of the positive and negative anchor points, after training, the main classifier can effectively classify and identify positive and negative anchor points. During the inference phase, the main classifier alone can accurately classify positive and negative anchor points, enabling the target detection model to ultimately obtain accurate detection results, such as the location and / or category of the target object in the image to be detected.
[0092] Through this embodiment, based on the multi-scale features obtained by multi-scale feature extraction of the image to be detected, the multi-scale features are first aggregated to obtain a first aggregated feature. Then, feature extraction is performed again on the first aggregated feature, that is, feature extraction is performed on the first aggregated feature to obtain the difference between the positive anchor point and the negative anchor point, so as to obtain a feature that characterizes the difference between the positive anchor point and the negative anchor point, namely an incremental feature. Then, based on the first aggregated feature and the incremental feature, a detection result of the image to be detected is obtained. The incremental feature carries effective and rich difference information between the positive anchor point and the negative anchor point, thereby effectively identifying and distinguishing the positive anchor point and the negative anchor point, improving the accuracy of the detection of the positive anchor point and the negative anchor point, and thus improving the accuracy of target detection in the image to be detected.
[0093] The image detection method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a PC, and even a high-performance mobile terminal.
[0094] Example 3
[0095] Reference Figure 3A , shows a flowchart of the steps of an image detection method according to embodiment three of the present invention.
[0096] In this embodiment, the image detection method provided by the embodiment of the present invention is described by taking the deployment of the target detection model on the server side (such as the cloud or server or SaaS platform) and calling the target detection model to perform image detection according to the image detection request of the client as an example.
[0097] The image detection method of this embodiment includes the following steps:
[0098] Step S302: Obtain an image detection request.
[0099] The image detection request carries information about the image to be detected, for example, the information may be image data of the image to be detected itself, or storage location information of the image to be detected, etc. Based on the information about the image to be detected, the image to be detected can be obtained.
[0100] Step S304: using an image detection method, performing image detection on the image to be detected requested by the image detection request.
[0101] The image detection method is the image detection method described in any one of the aforementioned embodiments 1 or 2. The specific image detection process can refer to the relevant description in the aforementioned embodiments and will not be repeated here.
[0102] In one feasible approach, the target detection model can be deployed on a SaaS platform, and this step can be implemented as follows: using the local target detection model of the SaaS platform and an image detection method, image detection is performed on the image to be detected requested by the image detection request.
[0103] The following is an example of deploying the target detection model on the SaaS platform to illustrate the above process. Figure 3B shown.
[0104] Figure 3B In the embodiment, the client sends an image detection request to the SaaS platform, which also carries the image data of the image to be detected; after receiving the image detection request, the SaaS platform calls the target detection model from the local storage device by the processing device, and performs image detection on the image to be detected according to the image detection method in the above-mentioned embodiment one or two through the target detection model; after completing the image detection of the image to be detected through the target detection model and obtaining the image detection result (such as the category or position of the target object in the image, etc.), the SaaS platform sends the image detection result to the client.
[0105] In the above, the target detection model is deployed on a SaaS platform as an example, but those skilled in the art should understand that the solution of this embodiment is also applicable to the case where the target detection model is deployed on other forms of servers.
[0106] It can be seen that through this embodiment, the target detection model is deployed on the server, and the server performs image detection based on the image detection request of the client. Since the target detection model can perform accurate image detection based on the positive anchor points and negative anchor points corresponding to the image to be detected, and since the target detection model is deployed on the server, it can effectively reduce the data processing burden of the client and ensure the effect and efficiency of image detection.
[0107] Example 4
[0108] Reference Figure 4 , shows a structural block diagram of an image detection device according to embodiment 4 of the present invention.
[0109] The image detection device of this embodiment includes: a first acquisition module 402, used to aggregate multi-scale features corresponding to the image to be detected to obtain a first aggregated feature; a second acquisition module 404, used to perform feature extraction on the first aggregated feature to obtain the difference between positive anchor points and negative anchor points, and obtain corresponding incremental features; a third acquisition module 406, used to obtain a detection result of the image to be detected based on the first aggregated feature and the incremental feature.
[0110] Optionally, the third acquisition module 406 is configured to obtain a second aggregate feature based on the incremental feature and the first aggregate feature; and input the second aggregate feature into the main classifier to obtain a detection result of the image to be detected.
[0111] Optionally, the image detection device is applied to a target detection model, which at least includes: a multi-scale feature extraction part, a positive anchor point and negative anchor point difference feature extraction part, and a classifier part, wherein the classifier part includes a main classifier and an auxiliary classifier; the image detection device also includes: a training module 408, which is used to train the target detection model using a sample image before the first acquisition module 402 aggregates the multi-scale features corresponding to the image to be detected.
[0112] Optionally, the training module 408 is used to perform multi-scale feature extraction on the sample image through the multi-scale feature extraction part to obtain corresponding multi-scale sample features; aggregate the multi-scale sample features to obtain first aggregated sample features; perform feature extraction on the first aggregated sample features to obtain the difference between positive anchor points and negative anchor points to obtain corresponding incremental sample features; obtain second aggregated sample features based on the first aggregated sample features and the incremental sample features; input the second aggregated sample features into the main classifier and input the incremental sample features into the auxiliary classifier; and train the target detection model based on the classification results of the main classifier and the classification results of the auxiliary classifier.
[0113] Alternatively, optionally, the training module 408 is used to perform multi-scale feature extraction on the sample image through the multi-scale feature extraction part to obtain corresponding multi-scale sample features; aggregate the multi-scale sample features to obtain first aggregated sample features; perform feature extraction on the first aggregated sample features to obtain the difference between positive anchor points and negative anchor points to obtain corresponding incremental sample features; obtain second aggregated sample features based on the first aggregated sample features and the incremental sample features; input the second aggregated sample features into the main classifier and input the first aggregated sample features into the auxiliary classifier; and train the target detection model based on the classification results of the main classifier and the classification results of the auxiliary classifier.
[0114] Optionally, when the training module 408 trains the target detection model based on the classification results of the main classifier and the classification results of the auxiliary classifier, it obtains the classification results output by the main classifier, wherein the classification results include: the first position of the positive anchor point difficult sample, the second position of other positive anchor point samples except the positive anchor point difficult sample, and the third position of the negative anchor point sample; positive samples are labeled according to the first position, ignored samples are labeled according to the second position, and negative samples are labeled according to the third position; the auxiliary classifier is classified and trained with the labeling results as the supervision label to obtain the classification results; the positive anchor point and negative anchor point difference feature extraction part in the target detection model is trained based on the classification results of the main classifier and the classification results of the auxiliary classifier.
[0115] Optionally, when the training module 408 trains the positive anchor point and negative anchor point difference feature extraction part in the target detection model based on the classification results of the main classifier and the classification results of the auxiliary classifier, the first position, the second position and the third position in the classification results output by the main classifier are masked; and the positive anchor point and negative anchor point difference feature extraction part in the target detection model is trained based on the masked classification results output by the main classifier and the classification results of the auxiliary classifier.
[0116] Optionally, the image detection device also includes: a feature enhancement module 410, which is used to perform fine-grained feature extraction on the image to be detected to obtain corresponding fine-grained features before the first acquisition module 402 aggregates the multi-scale features corresponding to the image to be detected; obtain global features of the image to be detected based on the fine-grained features; and perform multi-scale feature extraction on the image to be detected based on the global features to obtain corresponding multi-scale features.
[0117] Optionally, when the feature enhancement module 410 obtains the global features of the image to be detected based on the fine-grained features, it performs context information enhancement on the fine-grained features to obtain the context information corresponding to the fine-grained features; based on the context information, it performs global feature extraction of the image to be detected to obtain the global features of the image to be detected.
[0118] Optionally, when performing fine-grained feature extraction on the image to be detected to obtain corresponding fine-grained features, the feature enhancement module 410 performs fine-grained feature extraction on the image to be detected to obtain corresponding fine-grained features through a nearest neighbor interpolation algorithm.
[0119] Optionally, when obtaining the global features of the image to be detected, the feature enhancement module 410 obtains the initial global features of the image to be detected; and obtains the global features of the image to be detected based on the feature mean of the initial global features.
[0120] Optionally, when the feature enhancement module 410 performs fine-grained feature extraction on the image to be detected and obtains corresponding fine-grained features, it performs fine-grained feature extraction on each level of the image to be detected in multiple feature extraction levels based on the image features output at each level to obtain fine-grained features corresponding to each level.
[0121] Optionally, when the feature enhancement module 410 performs context information enhancement on the fine-grained features to obtain context information corresponding to the fine-grained features, it performs context information enhancement on the fine-grained features corresponding to each level to obtain context information corresponding to the fine-grained features of each level.
[0122] Optionally, when the feature enhancement module 410 extracts global features of the image to be detected based on the context information and obtains the global features of the image to be detected, it fuses context information of multiple feature extraction levels according to the context information corresponding to the fine-grained features of each level; and extracts global features of the image to be detected based on the fusion result to obtain the global features of the image to be detected.
[0123] The image detection device of this embodiment is used to implement the corresponding image detection methods in the aforementioned multiple method embodiments and has the beneficial effects of the corresponding method embodiments, which will not be described in detail here. In addition, the functional implementation of each module in the image detection device of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, and will not be described in detail here.
[0124] Example 5
[0125] Reference Figure 5 , shows a schematic structural diagram of an electronic device according to embodiment 5 of the present invention. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.
[0126] like Figure 5 As shown, the electronic device may include: a processor (processor) 502 , a communication interface (Communications Interface) 504 , a memory (memory) 506 , and a communication bus 508 .
[0127] in:
[0128] The processor 502 , the communication interface 504 , and the memory 506 communicate with each other via a communication bus 508 .
[0129] The communication interface 504 is used to communicate with other electronic devices or servers.
[0130] The processor 502 is configured to execute the program 510 , and specifically to execute the relevant steps in the above-mentioned image detection method embodiment.
[0131] Specifically, the program 510 may include program codes, which include computer operation instructions.
[0132] Processor 502 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in a smart device may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.
[0133] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0134] Program 510 can specifically be used to enable the processor 502 to perform the following operations: aggregate the multi-scale features corresponding to the image to be detected to obtain a first aggregate feature; perform feature extraction on the first aggregate feature to obtain the difference between the positive anchor point and the negative anchor point to obtain the corresponding incremental feature; and obtain the detection result of the image to be detected based on the first aggregate feature and the incremental feature.
[0135] In an optional embodiment, the program 510 is also used to enable the processor 502 to obtain the detection result of the image to be detected based on the first aggregate feature and the incremental feature: obtain the second aggregate feature based on the incremental feature and the first aggregate feature; input the second aggregate feature into the main classifier to obtain the detection result of the image to be detected.
[0136] In an optional embodiment, a target detection model is provided in the electronic device, and the target detection model includes at least: a multi-scale feature extraction part, a positive anchor point and negative anchor point difference feature extraction part, and a classifier part, and the classifier part includes a main classifier and an auxiliary classifier; the program 510 is also used to enable the processor 502 to train the target detection model using a sample image before aggregating the multi-scale features corresponding to the image to be detected.
[0137] In an optional embodiment, the program 510 is also used to enable the processor 502 to: perform multi-scale feature extraction on the sample image through the multi-scale feature extraction part to obtain corresponding multi-scale sample features; aggregate the multi-scale sample features to obtain first aggregated sample features; perform feature extraction on the first aggregated sample features to obtain the difference between positive anchor points and negative anchor points to obtain corresponding incremental sample features; obtain second aggregated sample features based on the first aggregated sample features and the incremental sample features; input the second aggregated sample features into the main classifier, and input the incremental sample features into the auxiliary classifier; and train the target detection model based on the classification results of the main classifier and the classification results of the auxiliary classifier.
[0138] In an optional embodiment, the program 510 is also used to enable the processor 502 to: perform multi-scale feature extraction on the sample image through the multi-scale feature extraction part to obtain corresponding multi-scale sample features; aggregate the multi-scale sample features to obtain first aggregated sample features; perform feature extraction on the first aggregated sample features to obtain the difference between positive anchor points and negative anchor points to obtain corresponding incremental sample features; obtain second aggregated sample features based on the first aggregated sample features and the incremental sample features; input the second aggregated sample features into the main classifier, and input the first aggregated sample features into the auxiliary classifier; and train the target detection model based on the classification results of the main classifier and the classification results of the auxiliary classifier.
[0139] In an optional embodiment, the program 510 is also used to enable the processor 502 to: obtain the classification results output by the main classifier when training the target detection model based on the classification results of the main classifier and the classification results of the auxiliary classifier, wherein the classification results include: the first position of the positive anchor point difficult sample, the second position of other positive anchor point samples except the positive anchor point difficult sample, and the third position of the negative anchor point sample; label the positive sample according to the first position, label the ignored sample according to the second position, and label the negative sample according to the third position; use the labeling results as the supervision label to perform classification training on the auxiliary classifier to obtain the classification results; train the positive anchor point and negative anchor point difference feature extraction part in the target detection model according to the classification results of the main classifier and the classification results of the auxiliary classifier.
[0140] In an optional embodiment, the program 510 is also used to enable the processor 502 to: shield the first position, the second position and the third position in the classification result output by the main classifier; and train the positive anchor point and negative anchor point difference feature extraction part in the target detection model according to the classification result output by the main classifier and the classification result of the auxiliary classifier when training the positive anchor point and negative anchor point difference feature extraction part in the target detection model according to the classification result output by the main classifier and the classification result of the auxiliary classifier after shielding.
[0141] In an optional embodiment, the program 510 is also used to enable the processor 502 to perform fine-grained feature extraction on the image to be detected before aggregating the multi-scale features corresponding to the image to be detected to obtain corresponding fine-grained features; obtain global features of the image to be detected based on the fine-grained features; and perform multi-scale feature extraction on the image to be detected based on the global features to obtain corresponding multi-scale features.
[0142] In an optional embodiment, the program 510 is also used to enable the processor 502 to: perform context information enhancement on the fine-grained features to obtain context information corresponding to the fine-grained features when obtaining the global features of the image to be detected based on the fine-grained features; and perform global feature extraction of the image to be detected based on the context information to obtain the global features of the image to be detected.
[0143] In an optional embodiment, the program 510 is also used to enable the processor 502 to extract fine-grained features from the image to be detected and obtain corresponding fine-grained features: extract fine-grained features from the image to be detected by a nearest neighbor interpolation algorithm to obtain corresponding fine-grained features.
[0144] In an optional embodiment, the program 510 is also used to enable the processor 502 to obtain the global features of the image to be detected: obtain the initial global features of the image to be detected; and obtain the global features of the image to be detected based on the feature mean of the initial global features.
[0145] In an optional embodiment, the program 510 is also used to enable the processor 502 to perform fine-grained feature extraction on the image to be detected and obtain corresponding fine-grained features: for each level of the multiple feature extraction levels of the image to be detected, fine-grained feature extraction is performed based on the image features output by each level to obtain fine-grained features corresponding to each level.
[0146] In an optional embodiment, the program 510 is also used to enable the processor 502 to perform context information enhancement on the fine-grained features to obtain the context information corresponding to the fine-grained features: perform context information enhancement on the fine-grained features corresponding to each level respectively to obtain the context information corresponding to the fine-grained features of each level.
[0147] In an optional embodiment, the program 510 is also used to enable the processor 502 to perform global feature extraction of the image to be detected based on the context information to obtain the global features of the image to be detected: according to the context information corresponding to the fine-grained features of each level, fuse the context information of multiple feature extraction levels; and extract the global features of the image to be detected based on the fusion results to obtain the global features of the image to be detected.
[0148] The specific implementation of each step in program 510 can be found in the corresponding descriptions of the corresponding steps and units in the above-mentioned image detection method embodiment, and will not be repeated here. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding process descriptions in the above-mentioned method embodiment, and will not be repeated here.
[0149] The electronic device of this embodiment first aggregates the multi-scale features obtained by performing multi-scale feature extraction on the image to be detected to obtain a first aggregated feature. Then, feature extraction is performed on the first aggregated feature again, that is, feature extraction is performed on the first aggregated feature to obtain the difference between the positive anchor point and the negative anchor point, so as to obtain a feature representing the difference between the positive anchor point and the negative anchor point, namely, an incremental feature. Furthermore, based on the first aggregated feature and the incremental feature, a detection result of the image to be detected is obtained. The incremental feature carries effective and rich information about the difference between the positive and negative anchor points, thereby effectively identifying and distinguishing the positive and negative anchor points, improving the accuracy of detection of the positive and negative anchor points, and thereby improving the accuracy of target detection in the image to be detected.
[0150] Example 6
[0151] Reference Figure 6 , shows a structural diagram of an attendance machine according to embodiment 6 of the present invention.
[0152] The attendance machine of this embodiment includes at least: a biometric information collection component 602 , a processor 604 , and a memory 606 .
[0153] in:
[0154] The biometric information collection component 602 is used to collect human biometric information and generate a biometric information image. In one embodiment, the human biometric information may be facial information. For example, the biometric information collection component 602 may be implemented as a camera to collect facial information and thereby generate a biometric information image, such as a facial image. Alternatively, in another embodiment, the human biometric information may be fingerprint information. For example, the biometric information collection component 602 may be implemented as a fingerprint sensor, a fingerprint collection module, or a fingerprint recognition module to collect fingerprint information and thereby generate a biometric information image, such as a fingerprint image.
[0155] Processor 604 is used to obtain the biometric information image, perform multi-scale feature extraction on the biometric information image and obtain corresponding multi-scale features; aggregate the multi-scale features to obtain first aggregate features; perform feature extraction on the first aggregate features to obtain the difference between positive anchor points and negative anchor points to obtain corresponding incremental features; obtain a biometric information verification result of the biometric information image based on the first aggregate features and the incremental features; and generate an attendance record based on the biometric information verification result, and send the attendance record to the memory 606.
[0156] In one feasible embodiment, when the processor 604 obtains the biometric verification result of the biometric image based on the first aggregate feature and the incremental feature, it can obtain a second aggregate feature based on the incremental feature and the first aggregate feature; input the second aggregate feature into the main classifier to obtain the biometric detection result corresponding to the biometric image.
[0157] Among them, the processing of the biometric information image by the above-mentioned processor 604 includes: performing multi-scale feature extraction on the biometric information image and obtaining corresponding multi-scale features; aggregating the multi-scale features to obtain a first aggregated feature; performing feature extraction on the first aggregated feature to obtain the difference between the positive anchor point and the negative anchor point to obtain a corresponding incremental feature; obtaining a biometric information verification result of the biometric information image based on the first aggregated feature and the incremental feature. The specific implementation of these processes can refer to the relevant description in the aforementioned embodiment one or two, and will not be repeated here. Similarly, when the processor 604 obtains the biometric information verification result of the biometric information image based on the first aggregated feature and the incremental feature, it can obtain a second aggregated feature based on the incremental feature and the first aggregated feature; input the second aggregated feature into the main classifier to obtain the biometric information detection result corresponding to the biometric information image. The specific implementation of these processes can also refer to the relevant description in the aforementioned embodiment one or two, and will not be repeated here.
[0158] After obtaining the biometric information verification result, such as a specific face recognition result or fingerprint recognition result, such as a user ID corresponding to the face or a user ID corresponding to the fingerprint, the processor 604 can match it with the corresponding information pre-stored in the memory 606, such as attendance user information (user ID, name, department, position, etc.). After matching the corresponding information, the processor 604 generates a corresponding attendance record in combination with the attendance information (such as attendance time, company name, company location, etc.), and sends the generated attendance record to the memory 606 for storage.
[0159] The memory 606 can be used to store the attendance record, the attendance user information, the attendance information, etc.
[0160] It can be seen that the attendance machine of this embodiment can realize effective identification of attendance users and accurate generation of attendance information, thereby improving the accuracy of attendance data.
[0161] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present invention can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present invention.
[0162] The method according to an embodiment of the present invention described above can be implemented in hardware, firmware, or be implemented as software or computer code that can be stored in a recording medium (such as CDROM, RAM, floppy disk, hard disk or magneto-optical disk), or be implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a special-purpose processor or programmable or special-purpose hardware (such as ASIC or FPGA). It will be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the image detection method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the image detection method shown here, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the image detection method shown here.
[0163] Those skilled in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present invention.
[0164] The above implementation methods are only used to illustrate the embodiments of the present invention, and are not intended to limit the embodiments of the present invention. Ordinary technicians in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of the present invention, and the scope of patent protection of the embodiments of the present invention should be defined by the claims.
Claims
1. An attendance machine, comprising at least: Bio-information collection components, processors, and memories; in, The biological information collection component is used to collect human biological information and generate a biological information image; The processor is configured to obtain the biometric image, perform multi-scale feature extraction on the biometric image and obtain corresponding multi-scale features; aggregate the multi-scale features to obtain a first aggregate feature; perform feature extraction on the first aggregate feature to obtain a difference between a positive anchor point and a negative anchor point to obtain a corresponding incremental feature; obtain a biometric verification result of the biometric image based on the first aggregate feature and the incremental feature, wherein the incremental feature and the first aggregate feature are input into a classifier for classification and identification, thereby determining the biometric verification result; generate an attendance record based on the biometric verification result, and send the attendance record to the memory; The memory is used to store the attendance record.
2. The attendance machine according to claim 1, wherein: The processor obtains a biometric information verification result of the biometric information image according to the first aggregate feature and the incremental feature, including: A second aggregate feature is obtained based on the incremental feature and the first aggregate feature; and the second aggregate feature is input into a main classifier to obtain a biological information detection result corresponding to the biological information image.
3. The attendance machine according to claim 1 or 2, wherein: The human biological information includes human facial information or human fingerprint information.
4. An image detection method, comprising: Aggregate the multi-scale features corresponding to the image to be detected to obtain a first aggregated feature; Performing feature extraction on the first aggregated features to obtain a difference between a positive anchor point and a negative anchor point to obtain a corresponding incremental feature; A detection result of the image to be detected is obtained based on the first aggregated features and the incremental features, wherein the incremental features and the first aggregated features are input into a classifier for classification and identification, thereby determining the detection result.
5. The method according to claim 4, wherein Obtaining a detection result of the image to be detected based on the first aggregated feature and the incremental feature includes: A second aggregate feature is obtained based on the incremental feature and the first aggregate feature; and the second aggregate feature is input into a main classifier to obtain a detection result of the image to be detected.
6. The method according to claim 4, wherein: The image detection method is applied to a target detection model, which at least includes: a multi-scale feature extraction part, a positive anchor point and negative anchor point difference feature extraction part, and a classifier part, wherein the classifier part includes a main classifier and an auxiliary classifier; Before aggregating the multi-scale features corresponding to the image to be detected, the method further includes: training the target detection model using sample images.
7. The method according to claim 6, wherein: The using sample images to train the target detection model includes: Performing multi-scale feature extraction on the sample image by the multi-scale feature extraction part to obtain corresponding multi-scale sample features; Aggregating the multi-scale sample features to obtain first aggregated sample features; Performing feature extraction for obtaining a difference between a positive anchor point and a negative anchor point on the first aggregated sample feature to obtain a corresponding incremental sample feature; Obtaining a second aggregated sample feature according to the first aggregated sample feature and the incremental sample feature; Inputting the second aggregated sample features into a main classifier, and inputting the incremental sample features into the auxiliary classifier; The target detection model is trained according to the classification results of the main classifier and the classification results of the auxiliary classifier.
8. The method according to claim 6, wherein: The using sample images to train the target detection model includes: Performing multi-scale feature extraction on the sample image by the multi-scale feature extraction part to obtain corresponding multi-scale sample features; Aggregating the multi-scale sample features to obtain first aggregated sample features; Performing feature extraction for obtaining a difference between a positive anchor point and a negative anchor point on the first aggregated sample feature to obtain a corresponding incremental sample feature; Obtaining a second aggregated sample feature according to the first aggregated sample feature and the incremental sample feature; Inputting the second aggregated sample features into a main classifier, and inputting the first aggregated sample features into an auxiliary classifier; The target detection model is trained according to the classification results of the main classifier and the classification results of the auxiliary classifier.
9. The method according to claim 7 or 8, wherein The training of the target detection model according to the classification results of the main classifier and the classification results of the auxiliary classifier includes: Obtaining a classification result output by the main classifier, wherein the classification result includes: a first position of a positive anchor point difficult sample, a second position of other positive anchor point samples except the positive anchor point difficult sample, and a third position of a negative anchor point sample; Performing positive sample labeling according to the first position, performing ignored sample labeling according to the second position, and performing negative sample labeling according to the third position; Using the labeled results as supervision labels, the auxiliary classifier is trained to obtain classification results; The positive anchor point and negative anchor point difference feature extraction part in the target detection model is trained according to the classification results of the main classifier and the classification results of the auxiliary classifier.
10. The method according to claim 9, wherein: The step of training the positive anchor point and negative anchor point difference feature extraction part in the target detection model according to the classification result of the main classifier and the classification result of the auxiliary classifier includes: masking the first position, the second position, and the third position in the classification result output by the main classifier; The positive anchor point and negative anchor point difference feature extraction part in the target detection model is trained according to the classification result output by the shielded main classifier and the classification result of the auxiliary classifier.
11. The method according to claim 4, wherein: Before aggregating the multi-scale features corresponding to the image to be detected, the method further includes: Performing fine-grained feature extraction on the image to be detected to obtain corresponding fine-grained features; Obtaining global features of the image to be detected based on the fine-grained features; Based on the global features, multi-scale features are extracted from the image to be detected to obtain corresponding multi-scale features.
12. The method according to claim 11, wherein Obtaining the global features of the image to be detected based on the fine-grained features includes: Performing context information enhancement on the fine-grained features to obtain context information corresponding to the fine-grained features; Based on the context information, global features of the image to be detected are extracted to obtain global features of the image to be detected.
13. The method according to claim 11 or 12, wherein: The extracting fine-grained features from the image to be detected to obtain corresponding fine-grained features includes: Fine-grained features are extracted from the image to be detected by using a nearest neighbor interpolation algorithm to obtain corresponding fine-grained features.
14. The method according to claim 11 or 12, wherein: The obtaining of the global features of the image to be detected includes: Obtaining initial global features of the image to be detected; The global features of the image to be detected are obtained according to the feature mean of the initial global features.
15. The method according to claim 12, wherein: The extracting fine-grained features from the image to be detected to obtain corresponding fine-grained features includes: For each level of the image to be detected in multiple feature extraction levels, fine-grained feature extraction is performed based on the image features output by each level to obtain fine-grained features corresponding to each level.
16. The method according to claim 15, wherein The performing context information enhancement on the fine-grained features to obtain context information corresponding to the fine-grained features includes: The context information of the fine-grained features corresponding to each level is enhanced respectively to obtain the context information corresponding to the fine-grained features of each level.
17. The method according to claim 16, wherein The extracting global features of the image to be detected based on the context information to obtain the global features of the image to be detected includes: According to the context information corresponding to the fine-grained features of each level, context information fusion is performed on multiple feature extraction levels; based on the fusion result, global features of the image to be detected are extracted to obtain the global features of the image to be detected.
18. An image detection method, comprising: Obtaining an image detection request, wherein the image detection request carries information of an image to be detected; An image detection method is used to perform image detection on the image to be detected requested by the image detection request, wherein the image detection method is the image detection method according to any one of claims 4 to 17.
19. The method according to claim 18, wherein The method of using an image detection method to perform image detection on the image to be detected requested by the image detection request includes: The local target detection model of the SaaS platform is used to perform image detection on the image to be detected requested by the image detection request using an image detection method.
20. An image detection device, comprising: A first acquisition module is used to aggregate multi-scale features corresponding to the image to be detected to obtain a first aggregated feature; A second acquisition module is configured to perform feature extraction on the first aggregated features to obtain a difference between a positive anchor point and a negative anchor point, thereby obtaining a corresponding incremental feature; The third acquisition module is used to obtain the detection result of the image to be detected based on the first aggregated features and the incremental features, wherein the incremental features and the first aggregated features are input into a classifier for classification and identification, thereby determining the detection result.
21. An electronic device comprising: A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the image detection method according to any one of claims 4 to 17.
22. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the image detection method according to any one of claims 4 to 17 is implemented.
Citation Information
Patent Citations
A fine-grained classification method for fashion women's wear images based on component detection and visual features
CN109145947A
Target detection model training method and device
CN110751185A