Sample Image Processing Method and Apparatus Based on Multi-channel Sample Tube Recognition Model
By performing grid segmentation, adversarial patch removal, and perturbation cleanup on batch sample tube images, combined with a multi-channel recognition model and credibility verification, the problem of low recognition accuracy in batch sample tube image acquisition was solved, and efficient information storage was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-03-10
AI Technical Summary
When acquiring images of batch sample tubes, the limitations of uniform acquisition conditions make it difficult to simultaneously achieve optimal imaging for each sample tube. This results in some areas of the acquired images being reflective or pixelated. Differences in the style and placement of sample tube labels or occlusions lead to low recognition accuracy and increased time spent on data entry.
By segmenting the sample tube images into a grid, a set of single-tube images is generated. Then, adversarial patch removal and adversarial perturbation cleanup are performed. A multi-channel sample tube recognition model is used for recognition, combined with credibility verification, to ensure that the information is accurately stored in the database.
It improves the recognition accuracy of batch sample tubes, reduces the time spent on information storage, effectively reduces occlusion and noise interference in images, and ensures the accuracy and efficiency of recognition information.
Smart Images

Figure CN121095104B_ABST
Abstract
Description
Technical Field
[0001] The embodiments disclosed herein relate to the field of computer technology, and specifically to a sample image processing method and apparatus based on a multi-channel sample tube recognition model. Background Technology
[0002] In laboratories and testing settings, it is often necessary to identify entire rows, boxes, or racks of sample tubes in batches to enable rapid sample storage, retrieval, and inventory. Currently, the common approach for processing batches of sample tubes is to use image recognition models to process and identify images containing the batches of sample tubes, and then store the information in a database.
[0003] However, when processing batches of sample tubes using the above method, the following technical problems often arise:
[0004] When acquiring images of batch sample tubes, the limitations of uniform acquisition conditions make it difficult to simultaneously achieve optimal imaging for each sample tube. As a result, some areas of the acquired batch sample tube images may have reflections or pixel disturbances. Furthermore, the label style and placement of each sample tube may differ or be obstructed, leading to a low accuracy rate in identifying batch sample tubes and increasing the time required for data entry. Summary of the Invention
[0005] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0006] Some embodiments of this disclosure provide sample image processing methods, apparatuses, electronic devices, and readable media to address the technical problems mentioned in the background section above.
[0007] In a first aspect, some embodiments of this disclosure provide a sample image processing method based on a multi-channel sample tube recognition model. The method includes: performing grid segmentation on acquired sample tube images to obtain a set of single-tube images, wherein the sample tube images are obtained by acquiring and transmitting images of a batch of sample tubes placed on a grid template, and each single-tube image in the single-tube image set represents a local region of a sample tube and corresponds to grid coordinate information; for each single-tube image in the single-tube image set, performing the following processing steps: performing adversarial patch removal processing on the single-tube image to generate a removed single-tube image; performing adversarial perturbation cleaning on the removed single-tube image to generate a cleaned single-tube image; performing sample tube recognition on the cleaned single-tube image using a pre-trained multi-channel sample tube recognition model to generate sample tube recognition information; performing credibility verification on each sample tube recognition information to obtain an information verification result; and, in response to determining that the information verification result indicates successful verification, storing the generated sample tube recognition information and the sample tube images in a database.
[0008] Secondly, some embodiments of this disclosure provide a sample image processing apparatus based on a multi-channel sample tube recognition model. The apparatus includes: a grid segmentation unit configured to perform grid segmentation on the acquired sample tube images to obtain a set of single-tube images, wherein the sample tube images are obtained by image acquisition and transmission of a batch of sample tubes placed on a grid template, and each single-tube image in the set of single-tube images represents a local region of a sample tube and corresponds to grid coordinate information; and a processing unit configured to perform the following processing steps for each single-tube image in the set of single-tube images: processing the single-tube images... The tube image is subjected to adversarial patch removal processing to generate a single tube image after removal; the single tube image after removal is subjected to adversarial perturbation cleaning to generate a cleaned single tube image; the cleaned single tube image is then used to identify the sample tubes using a pre-trained multi-channel sample tube recognition model to generate sample tube recognition information; a verification unit is configured to verify the credibility of each sample tube recognition information to obtain the verification results of each piece of information; and a storage unit is configured to store the generated sample tube recognition information and the sample tube image in a database in response to determining that the verification results indicate that the verification has passed.
[0009] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.
[0010] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
[0011] The above embodiments of this disclosure have the following beneficial effects: the sample image processing method based on a multi-channel sample tube recognition model according to some embodiments of this disclosure can improve the recognition accuracy of batch sample tubes, thereby reducing the time required for data entry into the database for batch sample tubes. Specifically, the reasons for the low recognition accuracy and long data entry time for batch sample tubes are as follows: when acquiring images of batch sample tubes, due to the limitation of uniform acquisition conditions, it is difficult to simultaneously achieve optimal imaging for each sample tube. Therefore, some areas of the acquired batch sample tube images may have reflections or pixel disturbances, and the label style and affixing position of each sample tube may differ or be obstructed, resulting in a low recognition accuracy for batch sample tubes and thus increasing the data entry time. Based on this, the sample image processing method based on a multi-channel sample tube recognition model according to some embodiments of this disclosure first performs grid segmentation on the acquired sample tube images to obtain a set of single tube images. The sample tube images are obtained after image acquisition and transmission of batch sample tubes placed on a grid template. Each single tube image in the single tube image set represents a local area of a sample tube and corresponds to grid coordinate information. Therefore, the overall sample tube image can be segmented into individual tube images, allowing subsequent processing to target each tube image and reducing background interference and cross-tube occlusion issues. Then, for each tube image in the aforementioned set, the following processing steps are performed: First, adversarial patch removal is applied to the tube image to generate a removed tube image. This anti-patch removal reduces structured occlusion and high-saturation light in the sample tube barcode and text areas. Second, adversarial perturbation cleaning is applied to the removed tube image to generate a cleaned tube image. This adversarial perturbation cleaning suppresses pixel interference caused by reflections, pixel-level noise, or malicious adversarial perturbations, restoring the true texture of the tube image, enabling the subsequent recognition model to extract stable features even in high-noise environments. Third, a pre-trained multi-channel sample tube recognition model is used to perform sample tube recognition on the cleaned tube image to generate sample tube recognition information. Therefore, by matching the input domain and sample tube recognition model channel to different information carriers in the cleaned single-tube image (e.g., sample tube barcode, label text, sample tube appearance), the recognition accuracy of different information in the sample tube can be improved. Then, the credibility of the recognition information of each sample tube is verified to obtain the information verification result. This filters out abnormal sample tube recognition information, preventing erroneous or low-credibility recognition information from being stored in the database. Finally, in response to the verification result indicating that the verification is successful, the generated recognition information of each sample tube and the sample tube image are stored in the database.Therefore, for the partial reflections or pixel disturbances in the images of batch sample tubes, the use of adversarial patch removal and anti-disturbance cleaning can effectively reduce occlusion and pixel noise in the images. Furthermore, by using a multi-channel sample tube recognition model to identify different information in a single tube image, the accurate identification of batch sample tube information can be achieved, thereby reducing the time required for batch sample tube information to be stored in the database. Attached Figure Description
[0012] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0013] Figure 1 This is a schematic diagram of an application scenario of the sample image processing method based on a multi-channel sample tube recognition model according to some embodiments of this disclosure;
[0014] Figure 2 This is a top-view diagram of a batch of sample tubes placed on a grid template in the sample image processing method based on a multi-channel sample tube recognition model according to the present disclosure.
[0015] Figure 3 This is a flowchart of some embodiments of the sample image processing method based on a multi-channel sample tube recognition model according to the present disclosure;
[0016] Figure 4 These are schematic diagrams of some embodiments of the sample image processing method apparatus based on a multi-channel sample tube recognition model according to the present disclosure;
[0017] Figure 5 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation
[0018] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0019] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0020] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0021] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0022] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0023] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0024] Figure 1 This is a schematic diagram of an application scenario of the sample image processing method based on a multi-channel sample tube recognition model according to some embodiments of this disclosure.
[0025] exist Figure 1In the application scenario, firstly, the computing device 107 can perform grid segmentation on the acquired sample tube image 106 to obtain a set of single tube images. The sample tube image 106 is obtained by acquiring and transmitting images of a batch of sample tubes 101 placed on a grid template. Each single tube image in the single tube image set represents a local region of a sample tube (e.g., single tube image 108) and corresponds to grid coordinate information. The batch of sample tubes 101 can consist of at least one row of sample tubes, with each row placed on a sample tube rack. Taking a single sample tube 102 as an example, each sample tube includes a sample tube barcode 103 and a sample tube label 104. The image acquisition device 105 can acquire images of the batch of sample tubes 101 from a 45-degree overhead view to obtain sample tube images 106. For the single tube images in the single tube image set (taking the segmented single tube image 108 as an example), the computing device 107 performs the following processing steps: First, it performs adversarial patch removal processing on the single tube image 108 to generate a single tube image after removal. The second step involves performing adversarial perturbation cleanup on the removed single-tube image to generate a cleaned single-tube image. The third step involves using a pre-trained multi-channel sample tube recognition model to perform sample tube recognition on the cleaned single-tube image, generating sample tube recognition information 109 for the corresponding single-tube image 108. Afterwards, the computing device 107 can verify the credibility of the generated sample tube recognition information 109 to obtain an information verification result. Finally, in response to determining that the information verification result indicates successful verification, the computing device 107 can store the generated sample tube recognition information 109 and the sample tube image 106 in the target database 110.
[0026] Figure 2 This is a top-view schematic diagram of a batch of sample tubes placed on a grid template in the sample image processing method based on a multi-channel sample tube recognition model according to the present disclosure.
[0027] In practice, batches of sample tubes can be placed on the grid template according to the corresponding positions of individual sample tubes. A top-view diagram illustrating the placement of batches of sample tubes on the grid template is shown below. Figure 2 As shown, Figure 2 This includes sample tubes 102, a test tube rack 201, and black grids 202 in a grid template. Each black grid in the grid template can be used to place a sample tube. The distance between the black grids in the grid template can be set according to the distance between the sample tubes in the actual sample tube rack.
[0028] It should be noted that the aforementioned computing device 107 can be either hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster composed of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device is software, it can be installed in the hardware devices listed above. It can be implemented as, for example, multiple software programs or software modules used to provide distributed services, or as a single software program or software module. No specific limitations are made here. It should be understood that... Figure 1 The number of computing devices in the system can be arbitrary, depending on the implementation requirements.
[0029] Continue to refer to Figure 3 The diagram illustrates flow 300 of some embodiments of a sample image processing method based on a multi-channel sample tube recognition model according to the present disclosure. This sample image processing method based on a multi-channel sample tube recognition model includes the following steps:
[0030] Step 301: Perform grid segmentation on the acquired sample tube images to obtain a set of single tube images.
[0031] In some embodiments, the entity executing the sample image processing method based on a multi-channel sample tube recognition model (e.g.) Figure 1 The computing device 107 shown can acquire sample tube images via wired or wireless connection and perform grid segmentation on the acquired sample tube images to obtain a set of single-tube images. The sample tube images can be obtained by acquiring and transmitting images of a batch of sample tubes placed on a grid template using an image acquisition device. Each single-tube image in the single-tube image set represents a local area of a sample tube and corresponds to grid coordinate information. The grid template can be a layout template composed of multiple rows of black grids. The number of black grid rows in the grid template can be adjusted according to the number of sample tubes in the batch. For example, if each row of the grid template includes 6 black grids and the batch contains 22 sample tubes, the grid template can be adjusted to 4 rows (i.e., the rounded-up result of the ratio of the number of sample tubes to the number of grids per row). The batch of sample tubes can consist of at least one row of sample tubes, with each row placed on a sample tube rack. The image acquisition device can be a camera. The grid coordinates corresponding to each single-tube image represent the position of the corresponding sample tube in the grid template. For example, a single tube image corresponding to grid coordinates (2, 6) can represent that the corresponding sample tube is located in the second row and sixth column of the grid template. Each sample tube in the above batch of sample tubes has a sample tube label and a sample tube barcode. The above sample tube images can be RGB images.
[0032] It should be noted that one black grid in the above grid template corresponds to the previous sample tube. The distance between each black grid in each row of the above grid template can be set according to the distance between each sample tube in the actual sample tube rack, and is not limited here. In actual business scenarios, the distance between adjacent sample tubes in the sample tube rack is fixed at the same level, so the distance between adjacent black grids in each row of the above grid template is also the same. The distance between each row of black grids in the above grid template can be flexibly adjusted according to preset layout conditions. The above preset layout conditions can be such that, at a preset image acquisition angle, the sample tubes in the front row (i.e., the side closer to the image acquisition device) do not obstruct the sample tube barcodes and sample tube labels of the sample tubes in the back row (i.e., the side farther from the image acquisition device). During image acquisition, the batch of sample tubes placed on the grid template are located in the center of the image, and the above image acquisition device can view downwards at the above preset image acquisition angle to acquire the image of the sample tubes. As an example, the above preset image acquisition angle can be 45 degrees.
[0033] In practice, the aforementioned execution entity can use a segmentation template pre-generated according to the aforementioned grid template and a preset image acquisition angle to perform grid segmentation on the acquired sample tube images, obtaining individual tube images as a set of individual tube images. The aforementioned segmentation template can be pixel-level cropping information formed by mapping the aforementioned grid template onto the actual pixel plane according to the aforementioned preset image acquisition angle. It includes the pixel center, pixel width and height, and cropping box coordinates of each black grid position in the image (the size of the cropping box can be set with reference to the image size of a single sample tube after being mapped onto the actual pixel plane according to the aforementioned preset image acquisition angle), which can be directly used for image segmentation.
[0034] It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G / 5G connections, WiFi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra wideband) connections, and other currently known or future wireless connection methods.
[0035] Step 302: For each single tube image in the above single tube image set, perform the following processing steps:
[0036] Step 3021: Perform adversarial patch removal processing on the single-tube image to generate a single-tube image after removal.
[0037] In some optional implementations of certain embodiments, the aforementioned execution entity may perform adversarial patch removal processing on the aforementioned single-tube image through the following steps to generate a single-tube image after removal:
[0038] The first step is to normalize the single-tube image to generate a single-tube image tensor. In practice, the execution entity can normalize the pixel values in the single-tube image one by one to generate the single-tube image tensor.
[0039] The second step involves feeding the single-tube image tensor into a lightweight image recognizer to generate removed image recognition information. This removed image recognition information characterizes the confidence level of the image recognition result. The lightweight image recognizer can be a model that takes the single-tube image tensor as input and the removed image recognition information as output, used to recognize information in the single-tube image. The lightweight image recognizer may include a barcode decoding tool and a text recognition network. For example, the barcode decoding tool may include various decoding tools (e.g., pyzbar decoding tool, zxing-cpp decoding tool) for recognizing barcode information in the image. The text recognition network may include a DBNet (Differentiable Binarization Network) network and a CRNN (Convolutional Recurrent Neural Network) network, used to detect and recognize predicted text information in the single-tube image, respectively. The removed image recognition information includes decoding confidence and text confidence. The decoding confidence can be a numerical value determined by the barcode decoding tool, characterizing the consistency of stripe decoding. The aforementioned text confidence score can be the average of the maximum character probabilities at each time step of the recognized text sequence output by the aforementioned text recognition network.
[0040] It should be noted that the above decoding confidence level is the ratio of the number of consistent decoding attempts to the total number of decoding attempts. In practice, the execution entity can rotate the single-tube image tensor a preset number of times by a preset rotation angle, and then use the various decoders included in the barcode decoder to perform stripe decoding on the single-tube image tensor obtained after each rotation in parallel, verifying whether the decoding information output by each decoder is consistent, thereby determining the number of consistent decoding attempts (i.e., the number of times all decoding information is the same). If one decoder fails to decode during a parallel decoding, then the decoding is considered inconsistent. As an example, the preset rotation angle is 15 degrees, and the preset number of attempts can be 10.
[0041] The third step is to perform patch removal processing on the single tube image based on the generated removal image recognition information to generate a single tube image after removal.
[0042] In some optional implementations of certain embodiments, the aforementioned execution entity may perform patch removal processing on the single-tube image based on the generated removal image recognition information through the following steps to generate a removed single-tube image:
[0043] The first step, based on the single-tube image, is to perform the following patch removal steps:
[0044] The first sub-step involves generating a masked single-tube image based on the generated image mask and the single-tube image. The generated masked single-tube image is a single-tube image where a portion of the image is covered by the mask. In practice, the executing entity can obtain the masked single-tube image by covering a region in the single-tube image with the generated image mask.
[0045] It should be noted that when the above patch removal step is executed for the first time, the execution entity can randomly generate a mask of random size (e.g., 16×16 patch) as an image mask to cover a random area in the above single tube image.
[0046] The second sub-step involves reconstructing the masked single-tube image using a pre-built image reconstruction model to obtain a region reconstruction image. This region reconstruction image can be a reconstructed image of the area covered by the mask. The image reconstruction model can be a neural network model that takes the masked single-tube image as input and the region reconstruction image as output to reconstruct the masked image region. For example, this image reconstruction model could be a MAE (Masked Autoencoder) model. Alternatively, it could be a ViT (Visual Transformer) model or a U-Net model.
[0047] The third sub-step involves using the reconstructed image to remove and replace regions in the single-tube image, resulting in a replaced single-tube image. In practice, the executing entity can use the reconstructed image to replace the regions covered by the image mask in the single-tube image, thus obtaining the replaced single-tube image.
[0048] The fourth sub-step involves generating the pixel residual image corresponding to the replaced single-tube image. In practice, the aforementioned execution entity can obtain the pixel residual image by subtracting the replaced single-tube image from the original single-tube image pixel by pixel.
[0049] The fifth sub-step involves generating removal image recognition information based on the replaced single-tube image and the aforementioned lightweight image recognizer. In practice, the executing entity can input the replaced single-tube image into the lightweight image recognizer to generate removal image recognition information corresponding to the replaced single-tube image.
[0050] The sixth sub-step involves generating an image mask based on the generated pixel residual image and a preset coverage coefficient sequence. The generated image mask corresponds to the high residual regions of the residual image. The preset coverage coefficients in the preset coverage coefficient sequence can be the proportion of the image mask covering the region of a single tube image at a given number of executions. The preset coverage coefficients in the preset coverage coefficient sequence are ordered in ascending order, representing the continuous increase in the coverage proportion of the image mask during the patch removal step. In practice, firstly, the execution entity can determine each high residual region in the pixel residual image using a residual threshold and generate corresponding region masks for each high residual region. The high residual region can be a region where each pixel residual value is higher than the residual threshold and the number of pixel residual values contained therein is greater than or equal to the region pixel count threshold. Then, the execution entity can select the preset coverage coefficient with the corresponding position from the preset coverage coefficient sequence as the target coverage coefficient according to the number of executions of the patch removal step. Afterward, the execution entity can generate a random mask other than the region masks according to the target coverage coefficient. Finally, the aforementioned execution entity can determine the generated region masks and random masks as image masks.
[0051] The second step involves determining that the generated removal image recognition information does not meet the valid removal conditions, and then identifying the replaced single-tube image as the removed single-tube image. The valid removal conditions can be that the text confidence and decoding confidence of the removal image recognition information generated in this patch removal step are less than or equal to the text confidence and decoding confidence of the removal image recognition information generated in the previous patch removal step.
[0052] Optionally, the above patch removal step may further include the following steps: in response to determining that the generated recognition information of each removed image meets the valid removal conditions, the replaced single tube image is used as the single tube image, and the above patch removal step is performed again.
[0053] The aforementioned content, as an inventive point of this disclosure, solves the technical problem that "in the unified image acquisition and transmission of batch sample tubes, there is often structured patch interference (such as reflection, blurring, and occlusion) and significant imaging noise interference, which reduces the clarity of sample tube barcodes or text in the image, and generates false edges and adversarial textures, thus leading to a decrease in image quality." Solving these factors can improve image quality. To achieve this, by performing multiple masking overlays on a single tube image and prioritizing the reconstruction of the covered areas, the occlusion of the sample tube image by reflection, blurring, and occlusion is gradually reduced, restoring the barcode structure of the sample tube barcode and the text continuity in the sample tube label. Through multiple masking overlays and reconstruction of the covered areas, the optimal imaging conditions for the corresponding single sample tube are simulated, thereby significantly reducing the interference of stripes or moiré patterns in the single tube image, and thus improving the image quality of the single tube image.
[0054] Step 3022: Perform anti-disturbance cleaning on the removed single-tube image to generate a cleaned single-tube image.
[0055] In some optional implementations of certain embodiments, the aforementioned execution entity may perform anti-disturbance cleaning on the removed single-tube image through the following steps to generate a cleaned single-tube image:
[0056] The first step is to generate a noise distribution map and a multi-dimensional feature matrix of the image based on the single tube image after removal.
[0057] The second step involves performing the following perturbation cleanup steps based on the image's multidimensional feature matrix:
[0058] The first sub-step involves generating a denoised single-tube image based on the preset number of texture similarities, the aforementioned multidimensional feature matrix of the image, the aforementioned single-tube image after removal, and the aforementioned noise distribution map.
[0059] The second sub-step involves generating denoised image recognition information based on the denoised single-tube image and the aforementioned lightweight image recognizer. In practice, the executing entity can input the denoised single-tube image into the lightweight image recognizer to obtain the denoised image recognition information. This denoised image recognition information also includes decoding confidence and text confidence.
[0060] The third sub-step involves determining the image confidence level based on the removed image recognition information and the denoised image recognition information corresponding to the removed single-tube image. In practice, the executing entity can subtract the decoding confidence level and text confidence level included in the denoised image recognition information from the decoding confidence level and text confidence level included in the removed image recognition information to obtain the decoding confidence level difference and text confidence level difference as the image confidence level.
[0061] The fourth sub-step involves updating the preset texture similarity quantity based on the target residual map in response to determining that the image confidence satisfies the iterative optimization condition, and then re-executing the perturbation cleanup step. The generated target residual map is determined by the denoised single-tube image and the removed single-tube image. The iterative optimization condition can be that the image confidence, including the decoding confidence difference and the text confidence difference, are both positive values, indicating that the perturbation cleanup step improved the image quality and positively optimized the removed single-tube image. In practice, firstly, the executing entity can determine the number of high residual regions in the pixel residual maps (i.e., the pixel residual maps generated in the last patch removal step) corresponding to the target residual map and the removed single-tube image using the residual threshold, respectively, as the first and second high residual region numbers. Then, in the normal state, the absolute value of the difference between the second and first high residual region numbers can be added to the preset texture similarity quantity to update the preset texture similarity quantity.
[0062] The fifth sub-step is to determine the denoised single-tube image as the cleaned single-tube image in response to the determination that the image credibility does not meet the above iterative optimization conditions.
[0063] In some optional implementations of certain embodiments, the aforementioned execution entity can generate a noise distribution map and a multi-dimensional feature matrix of the image based on the removed single-tube image through the following steps:
[0064] The first step is to normalize the removed single-tube image to generate a removed single-tube image tensor. In practice, the execution entity can normalize the pixel values in the removed single-tube image one by one to generate the removed single-tube image tensor.
[0065] The second step involves determining pixel-wise noise in the tensor of the removed single-tube image to generate a noise distribution map, where the noise distribution map has the same size as the tensor of the removed single-tube image. In practice, the execution entity can first perform an inverse gamma transform (e.g., with a gamma parameter of 2.2) on the tensor of the removed single-tube image channel by channel, mapping the pixels from the sRGB domain to the linear domain to obtain a linear domain image. Then, the execution entity can use a sliding window on the linear domain image to determine the mean and variance to fit a Poisson-Gaussian noise model (e.g., σ²(x) = αx + β), determine the noise standard deviation σ(x, y) per pixel, and normalize it to [0, 1] to obtain the noise distribution map.
[0066] The third step involves simultaneously dividing the removed single-tube image and the noise distribution map into blocks according to a preset block size and a preset step size, resulting in a set of removed single-tube image blocks and a set of noise distribution map blocks. In practice, the executing entity can use the block size as the window size and perform sliding window processing on the removed single-tube image and the noise distribution map with the preset step size to obtain the set of removed single-tube image blocks and the set of noise distribution map blocks.
[0067] The fourth step involves generating multi-dimensional feature information for each image patch based on the aforementioned set of removed single-tube image patches and noise distribution patch set. The generated multi-dimensional feature information corresponds to the removed single-tube image patches.
[0068] The fifth step is to determine the image multidimensional feature matrix based on the generated multidimensional feature information of each patch. In practice, the execution entity can sequentially process the multidimensional feature information of each patch according to its position and order in the removed single-tube image patch set, thereby obtaining the image multidimensional feature matrix.
[0069] In some optional implementations of certain embodiments, the execution entity can generate multi-dimensional feature information for each patch based on the set of removed single-tube image patches and the set of noise distribution patches using the following steps:
[0070] The first step, for each removed tube image block in the above set of removed tube image blocks, is to perform the following steps:
[0071] The first sub-step involves extracting frequency domain features from the removed single-tube image block to generate image frequency domain feature information. In practice, the execution entity can first perform a two-dimensional discrete cosine transform on the removed single-tube image in the luminance channel, using 16×16 sub-images as units, to obtain a coefficient matrix. Then, the execution entity can sequentially extract K low-frequency coefficients (e.g., between 8 and 16 dimensions) from the top left corner of the coefficient matrix as image frequency domain feature information.
[0072] The second sub-step involves extracting spatial features from the removed single-tube image block to generate image spatial feature information. In practice, the execution entity can determine the Sobel gradient on the brightness channel of the removed single-tube image block to obtain a gradient histogram. Then, the execution entity can use the gradient histogram to determine the local variance of brightness and the average gradient magnitude of the removed single-tube image block as image spatial feature information.
[0073] The third sub-step involves lightweight encoding of the removed single-tube image block to generate image-coded feature information. In practice, the execution entity can input the removed single-tube image block into a convolutional network consisting of three convolutional layers to generate image-coded feature information. Each convolutional layer contains a 3×3 convolutional kernel, a ReLU activation function, and a Batch Normalization (BN) layer.
[0074] The fourth sub-step involves generating image noise feature information based on the noise distribution map corresponding to the removed single-tube image block. In practice, the executing entity can crop the region corresponding to the removed single-tube image block from the noise distribution map and determine the noise mean and noise variance of the cropped region as image noise feature information.
[0075] The fifth sub-step involves sequentially concatenating the generated image frequency domain feature information, image spatial domain feature information, image coding feature information, and image noise feature information to obtain multi-dimensional feature information of the image patch.
[0076] In some optional implementations of certain embodiments, the execution entity can generate a denoised single-tube image by following these steps: based on a preset number of texture similarities, the multi-dimensional feature matrix of the image, the single-tube image after removal, and the noise distribution map.
[0077] The first step is to determine the feature similarity between every two patch multidimensional feature information in the aforementioned image multidimensional feature matrix. In practice, the executing entity can determine the cosine similarity between every two patch multidimensional feature information in the aforementioned image multidimensional feature matrix as the feature similarity.
[0078] The second step involves performing the following steps for each patch's multidimensional feature information in the aforementioned image multidimensional feature matrix:
[0079] The first sub-step involves sorting the similarities of each feature corresponding to the aforementioned multidimensional feature information of the map patch to obtain a feature similarity sequence. In practice, the executing entity can sort the similarities of each feature corresponding to (i.e., related to) the aforementioned multidimensional feature information of the map patch from largest to smallest to obtain a feature similarity sequence.
[0080] The second sub-step involves selecting, based on the aforementioned feature similarity sequence, the multi-dimensional feature information of patches that satisfy a preset number of texture similarities from the aforementioned image multi-dimensional feature matrix as the feature information of each connected patch. In practice, firstly, the executing entity can select each feature similarity with a preset number of texture similarities from the aforementioned feature similarity sequence as each target feature similarity. Then, the executing entity can determine the multi-dimensional feature information of patches corresponding to each target feature similarity as the feature information of each connected patch. As an example, the preset number of texture similarities can be 8.
[0081] The third sub-step involves determining the connection weights between each connected tile feature information. In practice, for each connected tile feature information, firstly, the execution entity can determine the noise distribution mean of the connected tile feature information and the tile multidimensional feature information within the corresponding regions of the noise distribution map. Then, the execution entity can use an exponential function (e.g., the exp() function in Python) to calculate the difference between the two noise distribution means and determine the noise similarity weight. Next, the execution entity can use an exponential function (e.g., the exp() function in Python) to determine the exponential function value corresponding to the Euclidean distance between the connected tile feature information and the tile multidimensional feature information as the feature weight. Finally, the execution entity can determine the connection weight between the tile multidimensional feature information and the connected tile feature information by multiplying the feature weight and the noise similarity weight. Thus, by mapping using an exponential function, sub-blocks with smaller Euclidean distances can receive weight values close to 1, while sub-blocks with larger Euclidean distances have weights close to 0, achieving the effect of "the more similar the texture, the greater the weight; the greater the texture difference, the smaller the weight."
[0082] The third step involves constructing a feature adjacency graph using the multi-dimensional feature information of the patches in the aforementioned image multi-dimensional feature matrix as nodes and the determined connection weights as side lengths. If there is a connection weight between any two multi-dimensional feature information of patches in the aforementioned image multi-dimensional feature matrix, then there is a connection between the two nodes; otherwise, there is no connection between the two nodes.
[0083] The fourth step involves stitching the removed single-tube image and the noise distribution map together to obtain the stitched single-tube image. In practice, the execution entity can use relevant library functions (such as the concat() function in Python) to stitch the noise distribution map as a channel onto the removed single-tube image to obtain the stitched single-tube image.
[0084] The fifth step involves extracting local features from the stitched single-tube image to generate local image feature information. In practice, the execution entity can use a convolutional network consisting of four convolutional layers to extract local features from the stitched single-tube image to generate local image feature information. Each convolutional layer in the network includes a 3×3 convolutional kernel and a ReLU activation function, with a stride of 1 and padding of 1.
[0085] The sixth step involves extracting non-local features from the feature adjacency graph based on the aforementioned multi-dimensional image feature matrix to generate non-local image feature information. The dimensions of this non-local feature information are aligned with those of the local image feature information. In practice, the executing entity can use the multi-dimensional image feature matrix as the graph node feature input to a graph neural network, propagating information across the graph feature adjacency graph to obtain node embeddings (i.e., non-local image feature information).
[0086] Specifically, the aforementioned execution entity can employ two graph convolutional layers as a graph neural network and use pre-calculated connection weights (i.e., edge lengths) for weighted aggregation. Subsequently, the execution entity can oversample each node embedding according to its corresponding removed single-tube image block position and backfill it into the image coordinate domain, generating a non-local feature map consistent with the image's non-local feature information in terms of size and alignment. As an example, the two graph convolutional layers can be composed of two GCNConv (Graph Convolutional Network) layers or GATConv (Graph Attention Network) layers connected together. Furthermore, during backfilling, a weighted average or Hanning window normalization can be applied to the overlapping regions to eliminate block boundary effects.
[0087] Step 7: Using a pre-built decoder, the aforementioned non-local and local image features are fused and decoded to obtain the denoised single-tube image. In practice, the execution entity can concatenate the non-local and local image features along the channel dimension to obtain fused feature information. Then, the execution entity can input the fused feature information into the decoding network (i.e., the decoder) to generate a residual map, and perform residual learning reconstruction on the residual map (i.e., subtracting the removed single-tube image from the residual map) to generate the denoised single-tube image. The decoding network (i.e., the decoder) can be composed of a convolutional layer containing a 3×3 convolution and a ReLU activation function, individual residual blocks (each residual block consists of two 3×3 convolutions and identity jump connections), and a convolutional layer containing a 3×3 convolution kernel, connected sequentially. As an example, the number of residual blocks can be four.
[0088] The aforementioned steps one through seven constitute an inventive point of this disclosure, solving the technical problem that "under uniform image acquisition conditions, single-tube images often contain fine-grained disturbances and real noise (such as stripes or moiré patterns, photosensitive noise, etc.), and these disturbances repeat across positions and overlap with the fine line frequency bands of sample tube label text and barcodes in the image, leading to a decrease in image quality and recognition accuracy." Solving these factors can improve image quality and information recognition accuracy. To achieve this, firstly, a noise level map is estimated for the cleaned single-tube image. Image patches with similar textures are connected through a nearest neighbor map, and information propagation is performed on the map to suppress fine-grained disturbances such as repeating stripes / moiré patterns across positions. Then, local convolution is used to suppress random noise and preserve pixel details of text structure and barcode edges in the image. Finally, residual decoding is used to remove noise components that should be removed from the sample tube image while preserving effective details. This significantly reduces adversarial perturbations and real noise in the image, making the text strokes and barcode module boundaries of the sample tube clearer, thereby improving the barcode decoding success rate and text recognition rate, and thus improving image quality and image information recognition accuracy.
[0089] Step 3023: Using a pre-trained multi-channel sample tube recognition model, sample tube recognition is performed on the cleaned single tube image to generate sample tube recognition information.
[0090] In some embodiments, the aforementioned execution entity can use a pre-trained multi-channel sample tube recognition model to perform sample tube recognition on the cleaned single-tube image to generate sample tube recognition information. The sample tube recognition information includes barcode decoding information, sample tube appearance information, and sample tube text information. The barcode decoding information, sample tube appearance information, and sample tube text information each correspond to a recognition confidence level, characterizing the accuracy of the recognized content. The barcode decoding information can be information obtained by decoding the barcode on the sample tube. The sample tube appearance information can be the appearance attributes of the sample tube (e.g., color, cap shape, tube shape). The sample tube text information can be the text content on the sample tube label.
[0091] It should be noted that the method for determining the recognition confidence level corresponding to the barcode recognition content of the sample tube can refer to the method for determining the decoding confidence level, and will not be repeated here.
[0092] In some optional implementations of certain embodiments, the aforementioned execution entity may perform sample tube identification on the cleaned single-tube image using a pre-trained multi-channel sample tube identification model through the following steps to generate sample tube identification information:
[0093] The first step involves preprocessing the cleaned single-tube image to generate text channel image tensors, appearance channel image tensors, and barcode channel image tensors. The multi-channel sample tube recognition model includes a text detection and recognition model, an appearance attribute detection model, and a stripe decoding model. In practice, firstly, the execution entity can normalize the cleaned single-tube image pixel-by-pixel to obtain the cleaned single-tube image tensor. Then, the execution entity can use the image tensor after grayscale processing (e.g., 0.299R + 0.587G + 0.114B) as the text channel image tensor. Next, the execution entity can use the image tensor after contrast enhancement (e.g., adaptive histogram equalization) as the barcode channel image tensor. Finally, the execution entity can use the image tensor after mild gamma correction (e.g., gamma parameter of 0.9 to 1.1) as the appearance channel image tensor.
[0094] The second step involves generating sample tube text information based on the aforementioned text channel image tensor and the aforementioned text detection and recognition model. The aforementioned text detection and recognition model can be a neural network model used to detect and recognize text content present in an image. This model includes both a text detection model and a text recognition model. For example, the text detection model can be, but is not limited to, a DBNet (Differentiable Binarization Network) model or a CTPN (Connectionist Text Proposal Network) model. The text recognition model can be a CRNN (Convolutional Recurrent Neural Network) model or a ViT-Seq2Seq (Vision Transformer based Sequence-to-Sequence Model) model. In practice, the executing entity can input the aforementioned text channel image tensor into the aforementioned text detection and recognition model to generate sample tube text information.
[0095] The third step involves generating sample tube appearance information based on the aforementioned appearance channel image tensor and the appearance attribute detection model. The appearance attribute detection model can be a multi-class neural network model used to detect sample tube appearance attributes (e.g., color, cap shape, tube shape). For example, the appearance attribute detection model can be, but is not limited to, YOLO series models, ResNet models, or Transformer models. In practice, the executing entity can input the aforementioned appearance channel image tensor into the appearance attribute detection model to generate sample tube text information.
[0096] The fourth step involves generating sample tube barcode decoding information based on the aforementioned barcode channel image tensor and the aforementioned stripe decoding model. The aforementioned stripe decoding model can be a model used to decode the barcode in an image. This model may include various decoding tools that rotate the aforementioned barcode channel image tensor a preset number of times by a preset rotation angle, perform parallel decoding on each rotated image tensor, and determine the number of consistent decoding operations. The aforementioned stripe decoding model may include, but is not limited to, the zxing-cpp decoding tool, the zbar decoding tool, and the pyzbar decoding tool. In practice, the executing entity can input the aforementioned barcode channel image tensor into the aforementioned stripe decoding model to obtain the sample tube barcode decoding information output by each decoding tool included in the stripe decoding model (with the sample tube barcode decoding information having the highest consistency rate as the output) and the corresponding recognition confidence (i.e., the ratio of the number of consistent decoding operations to the total number of decoding operations).
[0097] The fifth step is to determine the sample tube text information, the sample tube appearance information, and the sample tube barcode decoding information as the sample tube identification information.
[0098] Step 303: Verify the credibility of the identification information of each sample tube to obtain the information verification results.
[0099] In some embodiments, the aforementioned execution entity can perform credibility verification on the identification information of each sample tube to obtain an information verification result. This information verification result can be a Boolean variable. For example, a TRUE result indicates successful verification, while a FALSE result indicates failed verification. In practice, firstly, for each sample tube identification information, the execution entity can determine whether the recognition confidence levels corresponding to the barcode decoding information, sample tube appearance information, and sample tube text information included in each sample tube identification information are greater than or equal to a preset confidence threshold, thus obtaining a single information verification result. This single information verification result can be a Boolean variable. For example, a TRUE result indicates that the recognition confidence levels corresponding to the sample tube barcode identification content, sample tube appearance attributes, and sample tube label content included in the corresponding sample tube identification information are all greater than or equal to the preset confidence threshold; a FALSE result indicates that at least one of the recognition confidence levels corresponding to the sample tube barcode identification content, sample tube appearance attributes, and sample tube label content included in the corresponding sample tube identification information is less than the preset confidence threshold. As an example, the preset confidence level can be 0.989. Finally, the execution entity can perform a Boolean AND operation on the verification results of each individual piece of information to obtain the information verification result. Therefore, when there is a sample tube identification information with a recognition confidence level lower than the preset confidence level threshold, the identification information of each sample tube in the corresponding batch will be judged as verification failure, and the sample tube images corresponding to the batch of sample tubes can be reprocessed or manually verified.
[0100] Step 304: In response to the determination that the information verification result characterization verification has passed, the generated identification information of each sample tube and the above sample tube images are stored in the database.
[0101] In some embodiments, the executing entity may, in response to determining that the information verification result indicates successful verification, store the generated sample tube identification information and the sample tube image in a database. In practice, after successful information verification, the executing entity may store the sample tube identification information and the sample tube image in a target database. The target database may be a database used to store sample tube identification information.
[0102] Further reference Figure 4 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of a sample image processing device based on a multi-channel sample tube recognition model. These device embodiments are similar to... Figure 3 Corresponding to the method embodiments shown, this sample image processing device based on the multi-channel sample tube recognition model can be specifically applied to various electronic devices.
[0103] like Figure 4 As shown, a sample image processing device 400 based on a multi-channel sample tube recognition model in some embodiments includes: a grid segmentation unit 401, a processing unit 402, a verification unit 403, and a storage unit 404. The grid segmentation unit 401 is configured to perform grid segmentation on the acquired sample tube images to obtain a set of single-tube images. The sample tube images are obtained by acquiring and transmitting images of a batch of sample tubes placed on a grid template. Each single-tube image in the set represents a local region of a sample tube and corresponds to grid coordinate information. The processing unit 402 is configured to perform the following processing steps on each single-tube image in the set: perform adversarial patch removal processing on the single-tube image to generate a removed single-tube image; perform adversarial perturbation cleaning on the removed single-tube image to generate a cleaned single-tube image; perform sample tube recognition on the cleaned single-tube image using a pre-trained multi-channel sample tube recognition model to generate sample tube recognition information; the verification unit 403 is configured to perform credibility verification on the recognition information of each sample tube to obtain the verification results of each piece of information; and the storage unit 404 is configured to store the generated sample tube recognition information and the sample tube images in a database in response to determining that the verification results indicate that the verification has passed.
[0104] It is understandable that the units described in the sample image processing apparatus 400 based on the multi-channel sample tube recognition model are similar to the reference units. Figure 3 The steps in the described method correspond to each other. Therefore, the operations, features, and beneficial effects described above for the method are also applicable to the sample image processing device 400 based on the multi-channel sample tube recognition model and the units contained therein, and will not be repeated here.
[0105] The following is for reference. Figure 5 It illustrates electronic devices suitable for implementing some embodiments of the present disclosure (such as...). Figure 1 A schematic diagram of the structure of the computing device 107 shown. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0106] like Figure 5As shown, the electronic device 500 may include a processing unit 501 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in the read-only memory 502 or a program loaded from the storage device 508 into the random access memory 503. The random access memory 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, the read-only memory 502, and the random access memory 503 are interconnected via a bus 504. An input / output interface 505 is also connected to the bus 504.
[0107] Typically, the following devices can be connected to the input / output interface 505: input devices 506 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 5 Each box shown can represent a device or multiple devices as needed.
[0108] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a read-only memory 502. When the computer program is executed by the processing device 501, it performs the functions defined above in the methods of some embodiments of this disclosure.
[0109] In one embodiment, the processing device is used to run a computer program stored in a memory to perform the following steps: performing grid segmentation on the acquired sample tube images to obtain a set of single-tube images, wherein the sample tube images are obtained by acquiring and transmitting images of a batch of sample tubes placed on a grid template, and each single-tube image in the single-tube image set represents a local region of a sample tube and corresponds to grid coordinate information; for each single-tube image in the single-tube image set, performing the following processing steps: performing adversarial patch removal processing on the single-tube images to generate a removed single-tube image; performing adversarial perturbation cleaning on the removed single-tube images to generate a cleaned single-tube image; performing sample tube recognition on the cleaned single-tube images using a pre-trained multi-channel sample tube recognition model to generate sample tube recognition information; performing credibility verification on the recognition information of each sample tube to obtain an information verification result; and in response to determining that the information verification result indicates that the verification is passed, storing the generated recognition information of each sample tube and the sample tube images in a database.
[0110] This disclosure also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, and the method implemented when the program instructions are executed can be referred to the various embodiments of the methods described above.
[0111] The aforementioned computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. Alternatively, the aforementioned computer-readable storage medium may be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0112] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0113] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A method for processing a sample image based on a multi-channel sample tube identification model, the method comprising: obtaining a sample image of a sample tube; inputting the sample image into the multi-channel sample tube identification model; and outputting a result of the sample tube identification model. The method comprises the following steps: performing grid segmentation on the obtained sample tube image to obtain a single tube image set, wherein the sample tube image is obtained by image acquisition and transmission of a batch of sample tubes placed on a grid template, and each single tube image in the single tube image set represents a local area of a sample tube and corresponds to grid coordinate information; for each single tube image in the single tube image set, the following processing steps are performed: performing adversarial patch removal processing on the single tube image to generate a removed single tube image; performing adversarial perturbation cleaning on the removed single tube image to generate a cleaned single tube image; performing sample tube recognition on the cleaned single tube image through a pre-trained multi-channel sample tube recognition model to generate sample tube recognition information; verifying the credibility of each sample tube recognition information to obtain an information verification result; in response to determining that the information verification result represents a verification pass, storing the generated sample tube recognition information and the sample tube image in a database; wherein the single tube image is subjected to adversarial patch removal processing to generate a removed single tube image, comprising: performing normalization processing on the single tube image to generate a single tube image tensor; inputting the single tube image tensor into a lightweight image recognizer to generate removal image recognition information, wherein the removal image recognition information represents the credibility of the image recognition result; performing patch removal processing on the single tube image according to the generated removal image recognition information to generate a removed single tube image; wherein the patch removal processing on the single tube image comprises: based on the single tube image, the following patch removal steps are performed: generate a masked single tube image according to the generated image mask and the single tube image, wherein the generated masked single tube image is a single tube image with part of the area covered by the mask; perform image reconstruction on the masked single tube image according to a pre-constructed image reconstruction model to obtain a region reconstruction image; perform region removal and replacement on the single tube image through the region reconstruction image to obtain a replaced single tube image; generate a pixel residual image corresponding to the replaced single tube image; generate removal image recognition information according to the replaced single tube image and the lightweight image recognizer; generate an image mask according to the generated pixel residual image and a preset coverage coefficient sequence; in response to determining that the generated each removal image recognition information does not satisfy the effective removal condition, determining the replaced single tube image as the removed single tube image; in response to determining that the generated each removal image recognition information satisfies the effective removal condition, taking the replaced single tube image as the single tube image and performing the patch removal steps again.
2. The method of claim 1, wherein, The method comprises the following steps: generate a noise distribution map and an image multi-dimensional feature matrix according to the removed single tube image; based on the image multi-dimensional feature matrix, the following perturbation cleaning steps are performed: generate a denoised single tube image according to a preset texture similarity number, the image multi-dimensional feature matrix, the removed single tube image and the noise distribution map; generate denoised image recognition information according to the denoised single tube image and the lightweight image recognizer; According to the image recognition information of the removed single tube image and the denoised image, determine the image credibility; In response to determining that the image credibility meets the iterative optimization condition, update the preset texture similarity quantity according to the target residual image, and execute the disturbance cleaning step again, wherein the generated target residual image is determined by the denoised single tube image and the removed single tube image; In response to determining that the image credibility does not meet the iterative optimization condition, determine the denoised single tube image as the cleaned single tube image.
3. The method of claim 2, wherein, The generation of the noise distribution map and the image multi-dimensional feature matrix according to the removed single tube image comprises: normalizing the removed single tube image to generate a removed single tube image tensor; determining the noise of the removed single tube image tensor pixel by pixel to generate a noise distribution map, wherein the noise distribution map has the same size as the removed single tube image tensor; synchronously block processing the removed single tube image and the noise distribution map according to a preset block size and a preset step length to obtain a removed single tube image block set and a noise distribution map block set; generating multi-dimensional feature information of each block according to the removed single tube image block set and the noise distribution map block set, wherein the generated multi-dimensional feature information of each block corresponds to a removed single tube image block; determining an image multi-dimensional feature matrix according to the generated multi-dimensional feature information of each block.
4. The method of claim 3, wherein, The generation of the multi-dimensional feature information of each block according to the removed single tube image block set and the noise distribution map block set comprises: for each removed single tube image block in the removed single tube image block set, the following steps are executed: extracting the frequency domain feature of the removed single tube image block to generate image frequency domain feature information; extracting the spatial domain feature of the removed single tube image block to generate image spatial domain feature information; lightweight encoding the removed single tube image block to generate image encoding feature information; generating image noise feature information according to the noise distribution block corresponding to the removed single tube image block; splicing the generated image frequency domain feature information, image spatial domain feature information, image encoding feature information, and image noise feature information to obtain multi-dimensional feature information of each block.
5. The method of claim 1, wherein, The sample tube recognition of the cleaned single tube image by the pre-trained multi-channel sample tube recognition model to generate sample tube recognition information comprises: channel preprocessing the cleaned single tube image to generate a text channel image tensor, an appearance channel image tensor, and a barcode channel image tensor, wherein the multi-channel sample tube recognition model comprises a text detection and recognition model, an appearance attribute detection model, and a stripe decoding model; generating sample tube text information according to the text channel image tensor and the text detection and recognition model; generating sample tube appearance information according to the appearance channel image tensor and the appearance attribute detection model; generating sample tube stripe code decoding information according to the barcode channel image tensor and the stripe decoding model; The sample tube text information, the sample tube appearance information, and the sample tube stripe code decoding information are determined as sample tube identification information.
6. A sample image processing apparatus characterized by comprising: Comprise: A grid segmentation unit configured to perform grid segmentation on the obtained sample tube image to obtain a single tube image set, wherein the sample tube image is obtained by image acquisition and transmission of a batch of sample tubes placed on a grid template, and each single tube image in the single tube image set represents a local area of a sample tube and corresponds to grid coordinate information; A processing unit configured to, for each single tube image in the single tube image set, perform the following processing steps: performing an adversarial patch removal processing on the single tube image to generate a removed single tube image; performing an adversarial perturbation cleaning on the removed single tube image to generate a cleaned single tube image; performing sample tube identification on the cleaned single tube image by a pre-trained multi-channel sample tube identification model to generate sample tube identification information; the processing unit is further configured to: perform normalization processing on the single tube image to generate a single tube image tensor; input the single tube image tensor into a lightweight image recognizer to generate removed image identification information, wherein the removed image identification information represents the credibility of the image recognition result; perform patch removal processing on the single tube image according to the generated removed image identification information to generate a removed single tube image; wherein the patch removal processing on the single tube image comprises: based on the single tube image, performing the following patch removal steps: generate a masked single tube image according to the generated image mask and the single tube image, wherein the generated masked single tube image is a single tube image with part of the area covered by the mask; perform image reconstruction on the masked single tube image according to a pre-constructed image reconstruction model to obtain a region reconstruction image; perform region removal replacement on the single tube image through the region reconstruction image to obtain a replaced single tube image; generate a pixel residual image corresponding to the replaced single tube image; generate removed image identification information according to the replaced single tube image and the lightweight image recognizer; generate an image mask according to the generated pixel residual image and a preset coverage coefficient sequence; in response to determining that the generated each removed image identification information does not satisfy the effective removal condition, determine the replaced single tube image as the removed single tube image; in response to determining that the generated each removed image identification information satisfies the effective removal condition, take the replaced single tube image as the single tube image, and perform the patch removal steps again; a verification unit configured to perform credibility verification on each sample tube identification information to obtain each information verification result; an information storage unit configured to, in response to determining that the information verification result represents a verification pass, perform information storage of the generated each sample tube identification information and the sample tube image.
7. An electronic device, comprising: Comprise: one or more processors; a storage device having one or more programs stored thereon; when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1 to 5.
8. A computer readable medium characterized by A computer program product, comprising a computer readable medium having stored thereon the computer program, wherein the computer program is executable by a processor to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Body fluid specimen quality detection method and device, transportation device, equipment and medium
CN112037202A
Image classification method and device for multi-scale adversarial patches, storage medium and equipment
CN117523302A
Test tube multi-code detection method and device based on neural network, and model training method
CN120106111A