Sample collection detection method, device, and storage medium

By using image processing methods to detect the appearance of objects, the original images are acquired, target features are extracted and classified, and bounding boxes are used to divide and correct erroneous sample images. This solves the problems of low detection efficiency and difficulty in quality control in existing technologies, and achieves efficient and reliable detection results.

CN115830307BActive Publication Date: 2026-01-13WUYI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211648573.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-21
Publication Date
2026-01-13
Estimated Expiration
2042-12-21

AI Technical Summary

Technical Problem

In existing technologies, the efficiency of item appearance inspection is low and the quality is difficult to control. Manual inspection is also inefficient and of poor quality.

Method used

The original image of the region to be tested is acquired by image processing methods, the features of the target are extracted, bounding boxes are used to divide and classify the region, the misclassified sample images are identified and corrected, and the corrected feature map is output.

Benefits of technology

It improves testing efficiency and quality, reduces labor costs and errors, and provides reliable test results that are convenient for users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115830307B_ABST
    Figure CN115830307B_ABST
Patent Text Reader

Abstract

The application discloses a sample collection and detection method and device and a storage medium. The method comprises the following steps: collecting an original image in a to-be-detected area; extracting a detection target in the original image to obtain a plurality of target features; classifying the target features, and dividing the original image according to the classified target features through boundary boxes of different colors to obtain a plurality of first classification sample images; identifying the first classification sample images, modifying the first classification sample images with classification errors, and obtaining modified feature images; and outputting the unmodified first classification sample images and the modified feature images as classification detection results. The application can effectively save labor costs and reduce errors caused by manual work, has high sampling and detection efficiency and good quality, and can obtain reliable detection results after target features are obtained, classification is performed, the first classification sample images are identified and modified, and so on.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing, and in particular to a sample acquisition and detection method, device, and storage medium. Background Technology

[0002] Sample collection refers to the process of extracting a representative sample from a large batch of tested items for analysis. In the production process, finished products need to be tested to control product quality.

[0003] For items requiring visual inspection, current techniques rely on manual sampling and testing. This primarily involves direct visual inspection of the product's appearance or manual analysis of images captured by cameras. Such methods are inefficient, and the quality of manual inspection is difficult to control, resulting in low-quality results. Improving both efficiency and quality is a pressing issue that needs to be addressed. Summary of the Invention

[0004] This invention aims to at least solve one of the technical problems existing in the prior art. To this end, this invention provides a sample collection and detection method, device, and storage medium, aiming to improve the efficiency and quality of sampling and detection.

[0005] A first aspect of the present invention provides a sample collection and detection method, comprising:

[0006] Acquire the original image of the area to be tested;

[0007] Extract the detected targets from the original image to obtain multiple target features;

[0008] The target features are classified, and the original image is divided according to the classified target features using bounding boxes of different colors to obtain multiple first-class sample images;

[0009] The first category sample image is identified, and the first category sample image that is misclassified is modified to obtain the corrected feature image;

[0010] The unmodified first-class sample image and the corrected feature image are output as the classification detection results.

[0011] According to the above embodiments of the present invention, at least the following beneficial effects are achieved: First, an original image of the area to be tested is acquired; then, features of the detection targets in the original image are extracted and classified; based on the target features, the original image is divided into multiple first-classification sample images using bounding boxes of different colors. The first-classification sample images are used to highlight the location of the detection targets in the original image; the first-classification sample images are identified, and incorrectly classified first-classification sample images are corrected and covered; the final output classification detection result includes the first-classification sample images and the corrected feature images. Sampling and detecting the original image through image processing can effectively save labor costs and reduce errors introduced by manual operations. The sampling detection efficiency is high and the quality is good. After obtaining the target features, classification is performed, and the first-classification sample images are identified and modified, resulting in reliable detection results. Furthermore, the classified results are convenient for users.

[0012] According to some embodiments of the first aspect of the present invention, acquiring an original image of the area to be tested includes:

[0013] The area to be tested is photographed to obtain the captured image;

[0014] If the captured image contains the object to be tested, the captured image containing the object to be tested will be used as the original image.

[0015] According to some embodiments of the first aspect of the present invention, a target is extracted from the original image to obtain multiple target features, including:

[0016] Feature point detection algorithms are used to extract features from the target in the original image, resulting in multiple target features.

[0017] According to some embodiments of the first aspect of the present invention, feature extraction of a target in an original image is performed using a feature point detection algorithm to obtain multiple target features, and further includes:

[0018] The original image is brightened to obtain a highlight image;

[0019] Feature point detection algorithms are used to extract features from the targets in the highlighted image, resulting in multiple target features.

[0020] According to some embodiments of the first aspect of the present invention, target features are classified, and the original image is divided according to the classified target features using bounding boxes of different colors to obtain multiple first classification sample images, including:

[0021] The target features are classified using a feature classification model to obtain multiple target types;

[0022] The target features belonging to different target types in the original image are surrounded by bounding boxes of different colors to obtain multiple first-classification sample images corresponding to each bounding box.

[0023] According to some embodiments of the first aspect of the present invention, target features belonging to different target types in the original image are surrounded by bounding boxes of different colors to obtain multiple first classification sample images corresponding to each bounding box, including:

[0024] The bounding box prediction model is used to divide the target features in the original image into bounding boxes, resulting in a second classification sample image corresponding to multiple bounding boxes.

[0025] Based on the target type corresponding to each second-class sample image, the corresponding bounding box is adjusted to a different color to obtain multiple first-class sample images;

[0026] The samples are categorized and stored according to time sequence and the color of the bounding box of the first category sample image for future reference.

[0027] According to some embodiments of the first aspect of the present invention, a first classification sample image is identified, and a first classification sample image that is incorrectly classified is modified to obtain a corrected feature image, including:

[0028] The first category sample image is identified using a classification and recognition model to obtain the recognition result;

[0029] If the identification result is a classification error, the first classification sample image is modified to obtain a corrected feature image, which is then used to replace the modified first classification sample image.

[0030] According to some embodiments of the first aspect of the present invention, the classification and recognition model is a neural network model trained under supervision by a GAN network. The classification and recognition model is used to identify the type of a first classification sample image and compare it with the color of the bounding box to obtain the recognition result.

[0031] A second aspect of the present invention provides an electronic device, comprising:

[0032] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the sample acquisition and detection method of any one of the first aspects.

[0033] Since the electronic device of the second aspect embodiment applies the sample acquisition and detection method of any one of the first aspects, it has all the beneficial effects of the first aspect of the present invention.

[0034] According to a third aspect of the present invention, a computer storage medium is provided, which stores computer-executable instructions for performing the sample collection and detection method of any one of the first aspects.

[0035] Since the computer storage medium of the third aspect embodiment can execute the sample acquisition and detection method of any one of the first aspects, it has all the beneficial effects of the first aspect of the present invention.

[0036] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0037] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0038] Figure 1 This is a diagram showing the main steps of the sample collection and detection method according to an embodiment of the present invention;

[0039] Figure 2 yes Figure 1 A schematic diagram illustrating the specific steps of the S100 process;

[0040] Figure 3 yes Figure 1 A schematic diagram illustrating the specific steps of the S200 process;

[0041] Figure 4 yes Figure 3 A schematic diagram illustrating the specific steps of S210;

[0042] Figure 5 yes Figure 1 A schematic diagram illustrating the specific steps of the S300 process;

[0043] Figure 6 yes Figure 5 A schematic diagram illustrating the specific steps of the S320 process;

[0044] Figure 7 yes Figure 1 A schematic diagram illustrating the specific steps of the S400 system;

[0045] Figure 8 This is a schematic diagram of the processing flow of the bounding box prediction model;

[0046] Figure 9 yes Figure 1 A simplified flowchart before step S400;

[0047] Figure 10 This is a schematic diagram illustrating the specific processing flow of the sample collection and detection method according to an embodiment of the invention. Detailed Implementation

[0048] In the description of this invention, unless otherwise explicitly defined, terms such as "setting," "installing," and "connecting" should be interpreted broadly. Those skilled in the art can reasonably determine the specific meaning of these terms in this invention based on the specific content of the technical solution. In the description of this invention, "several" means one or more, "multiple" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. Furthermore, features specified as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "multiple" means two or more.

[0049] Sample collection, often simply called sampling, is a method of obtaining samples and a scientific research approach. It involves extracting a representative sample from a large batch of items to be tested for analysis. Sampling typically considers factors such as representativeness, typicality, timeliness, and procedural aspects of the sample testing. In production, finished products need to be tested to control product quality.

[0050] For items requiring visual inspection, current techniques rely on manual sampling and testing. This primarily involves direct visual inspection of the product's appearance or manual analysis of images captured by cameras. Such methods are inefficient, and the quality of manual inspection is difficult to control, resulting in inconsistent accuracy and low overall inspection quality. Improving both efficiency and quality is a pressing issue that requires discussion and resolution.

[0051] The following reference Figures 1 to 10 This invention describes a sample collection and detection method, device, and storage medium, which aims to improve the efficiency and quality of sampling and detection.

[0052] refer to Figure 1 As shown, the sample collection and detection method according to the first aspect of the present invention includes, but is not limited to, the following steps:

[0053] S100: Acquire the original image of the area to be tested;

[0054] S200: Extract the detected targets from the original image to obtain multiple target features;

[0055] S300: Classify the target features and divide the original image according to the classified target features using bounding boxes of different colors to obtain multiple first-class sample images;

[0056] S400: Identify the first category sample image and modify the first category sample image that is misclassified to obtain a corrected feature image;

[0057] S500: Outputs the unmodified first-class sample image and the corrected feature image as the classification detection result.

[0058] First, the original image of the target area is acquired. Then, features of the target in the original image are extracted and classified. Based on the target features, the original image is divided into multiple first-class sample images using bounding boxes of different colors. The first-class sample images are used to highlight the location of the target in the original image. The first-class sample images are identified, and misclassified first-class sample images are corrected and overwritten. The final output classification detection result includes the first-class sample images and the corrected feature images. By sampling and analyzing the original image through image processing, manual costs can be effectively saved and errors introduced by manual operation can be effectively reduced. The sampling detection is efficient and of high quality. After obtaining the target features, classification is performed and the first-class sample images are identified and modified. The resulting detection results are reliable, and the classified results are easy for users to use.

[0059] Understandably, referring to Figure 2 As shown, step S100 involves acquiring the original image of the area to be tested, including but not limited to the following steps:

[0060] S110: Take a picture of the area to be measured to obtain the captured image;

[0061] S120: The captured image contains the object to be tested, and the captured image containing the object to be tested is used as the original image.

[0062] Specifically, step S110 involves capturing an image of the area to be tested using a camera at a preset resolution. The camera is kept horizontal during capture to reduce image distortion. The preset resolution can be set to 3000*2000 dpi.

[0063] Understandably, referring to Figure 3 As shown, step S200: Extract the target from the original image to obtain multiple target features, including but not limited to the following steps:

[0064] S210: The feature point detection algorithm is used to extract features from the target in the original image to obtain multiple target features.

[0065] It's important to note that the feature point algorithm, also known as the ORB (Oriented Fast and Rotated Brief) algorithm, consists of two parts: feature point extraction and feature point description. Feature point extraction is derived from the FAST (Features from Accelerated Segment Test) algorithm, while feature point description is an improvement upon the BRIEF (Binary Robust Independent Elementary Features) algorithm. The feature point algorithm first identifies distinctive points and compares them with surrounding points. If a identified point differs from its surrounding points, it is considered a feature point, and feature extraction is performed. A feature point can be considered a sample. By using the above method to extract features from the original image, all detection targets are extracted, resulting in multiple feature targets. Feature extraction is fast and accurate. The extracted target features are saved and used as samples for classification in the subsequent S300 step.

[0066] Understandably, referring to Figure 4 As shown, step S210 involves extracting features from the target in the original image using a feature point detection algorithm to obtain multiple target features, and also includes, but is not limited to, the following steps:

[0067] S211: Brighten the original image to obtain a highlight image;

[0068] S212: Feature extraction is performed on the detected target in the highlighted image using a feature point detection algorithm to obtain multiple target features.

[0069] In step S211, the brightness of the original image is enhanced, thereby improving the contrast of the original image. When performing feature extraction in step S212, the high contrast of the highlight image can improve the accuracy of feature extraction of the detected target and reduce the problem of missed feature extraction.

[0070] Understandably, referring to Figure 5 As shown, in step S300, the target features are classified, and the original image is divided according to the classified target features using bounding boxes of different colors to obtain multiple first-classification sample images, including but not limited to the following steps:

[0071] S310: Classify the target features using a feature classification model to obtain multiple target types, where the target type is used to characterize the type to which the target feature belongs after being classified;

[0072] S320: Surround the target features belonging to different target types in the original image with bounding boxes of different colors to obtain multiple first classification sample images corresponding to each bounding box.

[0073] After different colored bounding boxes surround the corresponding target types in the original image, different colored bounding boxes are formed in the original image. The bounding boxes and the original images they surround constitute the first classification sample image.

[0074] Understandably, referring to Figure 6 As shown, in step S320, target features belonging to different target types in the original image are surrounded by bounding boxes of different colors to obtain multiple first classification sample images corresponding to each bounding box, including but not limited to the following steps:

[0075] S321: The bounding box prediction model is used to divide the target features in the original image into bounding boxes, and the second classification sample images corresponding to multiple bounding boxes are obtained.

[0076] S322: Based on the target type corresponding to each second-class sample image, adjust the corresponding bounding box to a different color to obtain multiple first-class sample images;

[0077] S323: Store samples in categories according to time order and the color of the bounding boxes of the first category sample images for future reference.

[0078] It should be noted that the bounding box prediction model is based on the YOLOv5 framework. In step S321, all images corresponding to all target features form a training set. The width and height of the images in the training set are extracted and corrected to absolute coordinates. The K-means algorithm is used to cluster all detection boxes in the training set to obtain k bounding boxes. The obtained bounding boxes are mutated using a genetic algorithm. Bounding boxes with good mutated results are retained, while others are skipped. Finally, the optimal bounding box is output to segment the target features in the original image.

[0079] When applied to industrial production, machine vision inspection can replace manual labor in image acquisition, feature extraction, classification and recognition, and classification storage, which can significantly reduce human involvement and thus improve the reliability of acquisition and recognition work.

[0080] Step S322: Colors are added by adjusting the parameters of the bounding boxes. Different colors are used for the bounding boxes according to different target types; that is, the color of the bounding boxes is used to represent the type of the target in the first classification sample image. Step S323: The first classification sample images corresponding to different colored bounding boxes are stored in different storage spaces. The first classification sample images in the corresponding storage spaces are sorted and stored according to the time (year, month, day, hour, minute, second) for easy user querying.

[0081] Understandably, referring to Figure 7As shown, step S400 involves identifying the first classification sample image and modifying the incorrectly classified first classification sample image to obtain a corrected feature image, including but not limited to the following steps:

[0082] S410: The first category sample image is identified using a classification recognition model to obtain the recognition result;

[0083] S420: When the recognition result is a classification error, modify the first classification sample image to obtain a corrected feature image and replace the modified first classification sample image.

[0084] It should be noted that the classification model is used to identify the first classification sample image to determine whether the type of the detected target in the first classification sample image corresponds to the color of the bounding box. If they do not correspond, the identification result is a classification error; if they correspond, the classification result is a correct classification. By identifying and judging the first classification sample image in this way, the reliability and accuracy of the final aggregated classification detection results can be effectively improved.

[0085] Understandably, referring to Figure 7 As shown, after step S410, after identifying the first classification sample image through the classification recognition model and obtaining the recognition result, the following steps are also included, but are not limited to:

[0086] S430: When the identification result is that the classification is correct, retain the corresponding first-class sample image.

[0087] Understandably, the classification and recognition model is a neural network model trained under supervision using a GAN network. The classification and recognition model is used to identify the type of the first classification sample image and compare it with the color of the bounding box to obtain the recognition result.

[0088] It's important to note that GAN (Generative Adversarial Network) networks generally consist of a generator and a discriminator. The generator learns the features of the training data and, guided by the discriminator, tries to fit the noise distribution as closely as possible to the true distribution of the training data, thus generating similar data with the features of the training set. The discriminator is responsible for distinguishing between real and fake input data generated by the generator and feeding the distinction back to the generator. The generator and discriminator in a GAN network are trained alternately until the data generated by the generator is indistinguishable from real data and reaches a balance with the discriminator's capabilities. Supervised training of a GAN neural network model results in a classification and recognition model with strong classification capabilities and reliable recognition results.

[0089] To further illustrate the sample collection and detection method provided in this application, the following explanation is provided in conjunction with specific examples / scenarios.

[0090] In step S321, the input dimension of the bounding box prediction model is 640*640*3, which is a 3-channel RGB color image with a width and height of 640 after processing of the original image. After processing, the output dimension of the detection layer at the three scales is s*s*na*(t x +t y +t w +t h +t o +nc), where s*s is the number of grids, na is the number of predefined prior boxes for each scale, and nc is the number of categories to be predicted. Taking a large scale s=20, na=3, nc=3 as an example, the output dimension of the detection layer with this grid structure is 20*20*3*(5+3)=9600.

[0091] The main prediction parameters of the network model include bounding box related parameters t. x t y t w t h Bounding box confidence t o And the confidence level t of the i-th category ci These parameters need to be decoded using the following formula to obtain the final predicted bounding box.

[0092] When processing the border, the original border is first predicted. The formula for the original border is as follows:

[0093] b x =2σ(t) x )-0.5+c x

[0094] b y =2σ(t) y )-0.5+c y

[0095] b w =p w (2σ(t w )) 2

[0096] b h =p h (2σ(t h )) 2

[0097] score i =confidence*Pr(Class) i )-σ(t o )*σ(t ci )

[0098] Then, the final predicted bounding box is estimated based on the original bounding box:

[0099] b x =(2σ(t) x )-0.5+c x )*stride

[0100] b y =(2σ(t) y )-0.5+c y )*stride

[0101] b w =(2σ(t) w )) 2 *anchor_grid

[0102] b h =(2σ(t) h )) 2 *anchor_grid

[0103] Among them, b x b y These are the x and y coordinates of the center of the bounding box, respectively. w b h These are the width and height of the bounding box, respectively, c x c y p represents the coordinate distance between the grid occupied by the center of the bounding box and the grid at the top left corner. w p h These are the width and height of the prior bounding box.

[0104] Reference Figure 8 c x c y This represents the grid coordinates corresponding to the currently predicted tensor, with a value range of [0, grid_size) and a stride of [8, 16, 32]. For example, if the input is [416, 416, 3], and the predicted output tensor is [batch, 52, 52, 3, 5 + num_class], then c x It is in the range [0, 52) with a stride of 8. Similarly, the value range of anchor_grid is [0, image_size], which is specifically calculated by anchor * stride. The anchor is processed to the range [0, grid_size) and then enlarged to the original image input size [0, image_size) by *stride.

[0105] The Intersection over Union (IOU) value is the ratio of the intersection between the predicted bounding box size and the ground truth bounding box size to the union between the two sizes. The IOU value is used to evaluate the predicted bounding boxes. A larger IOU value makes it easier to treat different predictions for the same detected target as multiple predictions for multiple targets, resulting in multiple predictions for a single target (i.e., one target being surrounded by multiple bounding boxes). A smaller IOU value makes it easier to treat different predictions for multiple targets as different predictions for a single target, resulting in multiple targets being classified into only one bounding box. The bounding boxes are corrected using this method to output the optimal bounding box.

[0106] In step S410, the incorrectly classified samples are identified using a GAN-supervised classification model. The GAN network includes a generator and a discriminator. The training optimization objective formula for GAN is shown below:

[0107]

[0108] Where V(D, G) represents the difference between the generated sample and the real sample, expressed by the cross-entropy loss of binary classification, and E represents the entropy, x ~ p data (x) indicates that x comes from the true data distribution (p) data D(x) represents the discriminator, and D(G(z)) represents the discriminator whose input data is fake data generated by the generator. This means that, with the generator fixed, the parameters of the discriminator D are updated by maximizing the cross-entropy loss V(D,G). This means that the generator should minimize the cross-entropy loss V(D,G) between real and fake images while maximizing the cross-entropy loss between the discriminator and the discriminator, thereby adjusting the generator.

[0109] The specific training steps for the classification and recognition model are as follows:

[0110] First, train the discriminator: label the real data in the training set with a real label (1) and label the fake data generated by the generator with a fake label (0). Batch the labeled real and fake data and send them to the discriminator to train it. Calculate the cross-entropy loss and adjust the discriminator's parameters so that the discriminator's judgment result for real data approaches 1 (close to true) and the judgment result for fake data approaches 0 (close to false). This process only adjusts and updates the discriminator's parameters and does not modify the generator's parameters.

[0111] Retrain the generator: Feed the Gaussian noise z into the generator, then label the fake data generated by the generator with a true label (i.e., assign a value of 1) and feed it into the discriminator. Calculate the cross-entropy loss and adjust the generator parameters so that the discrimination result of the fake data generated by the generator approaches 1, i.e. approaches true. In this process, only the generator parameters are updated and adjusted, and the discriminator parameters are not modified.

[0112] Reference Figure 9 As shown, before modifying the misclassified samples in step S400, the steps of the sample collection and detection method can be summarized as follows: image collection, feature extraction, sample acquisition, and classification storage.

[0113] Specifically, the process involves acquiring raw images through image capture; extracting features from the detected targets in the raw images and classifying them to obtain multiple first-class sample images; during manual modification, the process enters edit mode to correct the bounding box colors of the incorrectly classified first-class sample images, resulting in corrected feature maps; and finally, the corrected feature maps and the first-class sample images are classified and stored according to the classification results. The above processing flow is referenced. Figure 10 As shown.

[0114] In addition, a second aspect of the present invention provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor.

[0115] The processor and memory can be connected via a bus or other means.

[0116] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0117] The non-transient software program and instructions required to implement the sample acquisition and detection method of the first aspect embodiment described above are stored in a memory. When executed by a processor, the sample acquisition and detection method in the above embodiment is executed, for example, the method steps S100 to S500, S110 to S120, S210, S211 to S212, S310 to S320, S321 to S323, and S410 to S430 described above are executed.

[0118] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0119] Furthermore, a third aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions that are executed by a processor or controller, for example, by a processor in the above-described device embodiment, causing the processor to perform the sample acquisition and detection method in the above-described embodiment, for example, performing the method steps S100 to S500, S110 to S120, S210, S211 to S212, S310 to S320, S321 to S323, and S410 to S430 described above.

[0120] Those skilled in the art will understand that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, signal structures, program modules, or other signals). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, signal structures, program modules, or other signals in modulated signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0121] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0122] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A sample collection testing method, characterized by, The method comprises the following steps: collecting an original image in a to-be-tested region; extracting detection targets in the original image to obtain a plurality of target features; classifying the target features, and dividing the original image according to the classified target features by using boundary boxes of different colors to obtain a plurality of first classification sample images; identifying the first classification sample images, and modifying the first classification sample images with classification errors to obtain modified feature images; outputting the first classification sample images without modification and the modified feature images as classification detection results; the step of classifying the target features and dividing the original image according to the classified target features by using boundary boxes of different colors to obtain a plurality of first classification sample images comprises the following steps: classifying the target features by using a feature classification model to obtain a plurality of target types; surrounding the target features belonging to different target types in the original image with boundary boxes of different colors to obtain a plurality of first classification sample images corresponding to the boundary boxes comprises the following steps: dividing the original image by using a boundary box prediction model to obtain a plurality of second classification sample images corresponding to the boundary boxes; adjusting the corresponding boundary boxes to different colors according to the target types corresponding to each second classification sample image to obtain a plurality of first classification sample images; classifying and storing the first classification sample images according to the time sequence and the colors of the boundary boxes of the first classification sample images for query; the step of identifying the first classification sample images and modifying the first classification sample images with classification errors to obtain modified feature images comprises the following steps: identifying the first classification sample images by using a classification identification model to obtain an identification result; when the identification result is a classification error, modifying the first classification sample images to obtain modified feature images and replacing the modified first classification sample images; the classification identification model is a neural network model supervised trained by using a GAN network, and the classification identification model is used for type identification of the first classification sample images and comparison with the colors of the boundary boxes to obtain the identification result.

2. The sample collection detection method of claim 1, wherein, The step of collecting an original image in a to-be-tested region comprises the following steps: taking a photograph of a to-be-tested region to obtain a photographed image; detecting that the photographed image contains a to-be-tested object, and taking the photographed image containing the to-be-tested object as the original image.

3. The sample collection detection method of claim 2, wherein, The step of extracting detection targets in the original image to obtain a plurality of target features comprises the following steps: extracting features of the detection targets in the original image by using a feature point detection algorithm to obtain a plurality of target features.

4. The sample collection detection method of claim 3, wherein, The step of extracting features of the detection targets in the original image by using a feature point detection algorithm to obtain a plurality of target features further comprises the following steps: performing a brightening process on the original image to obtain a highlight image.

5. An electronic device, comprising: The method comprises the following steps: a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the sample collection and detection method according to any one of claims 1 to 4.

6. A computer storage medium, characterized in that Computer executable instructions are stored, and the computer executable instructions are used to execute the sample collection detection method in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Target detection method and device

    CN111950543A

  • YOLOv5-based scale adaptive target detection method and storage medium

    CN114926722A