Method and device for constructing training sample of color recognition of multi-well plate and computer equipment
By constructing training samples for perforated plate color recognition and employing the YOLOv8 deep learning model, the problems of low efficiency and poor accuracy in perforated plate color recognition were solved, achieving highly accurate automated recognition in complex scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-12
- Publication Date
- 2026-03-24
AI Technical Summary
In existing technologies, color recognition of perforated plates relies on manual visual inspection or spectral analysis, which is inefficient and inaccurate, and makes it difficult to handle the color characteristics of perforated plates under complex lighting conditions.
By determining multiple sample collection dimensions for perforated plate color recognition, including color category, perforated plate pose, perforated plate occlusion state, and illumination changes, an initial sample image set is constructed. The YOLOv8 deep learning model is then used for training to obtain a trained perforated plate color recognition model, achieving end-to-end detection.
It improves the accuracy and automation of color recognition in porous plates, and can stably identify the color of micropores in porous plates in complex scenarios, with greater accuracy compared to traditional methods.
Smart Images

Figure CN121505364B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of materials testing technology, and in particular to a method, apparatus and computer equipment for constructing training samples for color recognition of porous plates. Background Technology
[0002] Multi-well plates are widely used in biological / chemical experiments, industrial quality inspection, and environmental monitoring. In biological experiments, color recognition of multi-well plates allows for accurate differentiation of microparticles carrying different drugs; in industrial quality inspection, color recognition enables the sorting of microspheres on production lines, improving product yield; and in environmental monitoring, color recognition identifies pollutants in water bodies, facilitating accurate environmental monitoring.
[0003] However, the color recognition of perforated plates in related technologies relies on manual visual inspection or spectral analysis, which is inefficient and results in low accuracy of color recognition. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for constructing training samples for multi-well plate color recognition that can improve the accuracy of multi-well plate color recognition, in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a method for constructing training samples for color recognition of a multi-well plate, including:
[0006] Determine multiple sample collection dimensions for color recognition of a perforated plate; the multiple sample collection dimensions include at least color category, perforated plate orientation, perforated plate occlusion state, and illumination change;
[0007] According to each of the sample acquisition dimensions and the corresponding acquisition parameters for each of the sample acquisition dimensions, the initial sample image set of the porous plate under multiple sample acquisition dimensions is determined;
[0008] For each initial sample image in the initial sample image set, the bounding box of the smallest labeled unit in each initial sample image is determined, and the color label of the bounding box is determined according to the fill color of the smallest labeled unit, thus obtaining a sample image set with the color label; the fill color is used to characterize the concentration of the detectable in the smallest labeled unit.
[0009] Obtain a multi-well plate color recognition model determined based on YOLOv8;
[0010] The perforated plate color recognition model is trained based on the sample image set until a preset training termination condition is met, resulting in a well-trained perforated plate color recognition model.
[0011] In one embodiment, training the perforated plate color recognition model based on the sample image set until a preset training termination condition is met to obtain a trained perforated plate color recognition model includes:
[0012] The sample image set is divided according to color category to obtain multiple sample image subsets;
[0013] Each subset of sample images is divided according to a preset ratio to obtain a sample image training set, a sample image test set, and a sample image verification set; wherein each of the sample image training set, sample image test set, and sample image verification set includes sample images corresponding to multiple sample acquisition dimensions;
[0014] The perforated plate color recognition model is trained based on the sample image training set, sample image test set, and sample image verification set until the preset training termination condition is met, thus obtaining the trained perforated plate color recognition model.
[0015] In one embodiment, training the perforated plate color recognition model based on the sample image training set, sample image test set, and sample image verification set until a preset training termination condition is met to obtain a trained perforated plate color recognition model includes:
[0016] The sample image training set is augmented to obtain an augmented sample image training set.
[0017] The perforated plate color recognition model is trained based on the enhanced sample image training set, sample image test set, and sample image verification set until the preset training termination condition is met, thus obtaining the trained perforated plate color recognition model.
[0018] In one embodiment, the enhancement process includes at least one of random brightness adjustment, affine transformation, simulated occlusion, and background replacement; the enhancement process on the sample image training set to obtain the enhanced sample image training set includes:
[0019] Obtain randomly generated brightness adjustment coefficients, and perform random brightness adjustment on the training sample images in the sample image training set according to the brightness adjustment coefficients to obtain an enhanced sample image training set including color changes under different light intensities;
[0020] And / or, obtain the perforated plate posture adjustment parameters, and perform affine transformation on the training sample images in the sample image training set according to the perforated plate posture adjustment parameters to obtain a training set of enhanced sample images including different perforated plate postures.
[0021] And / or, obtain simulated occlusion parameters, and simulate occlusion on the training sample images in the sample image training set according to the simulated occlusion parameters to obtain an enhanced sample image training set including different occlusion situations;
[0022] And / or, obtain a pre-constructed real-scene background image library, embed training sample images from the sample image training set into randomly determined target background images, and obtain an enhanced sample image training set including different target background images; the target background images are determined from the real-scene background image library.
[0023] In one embodiment, the sample image test set includes at least extreme interference samples for accurately evaluating the genericity capability of the perforated plate color recognition model. The extreme interference samples include at least test sample images where the proportion of reflective pixels in the hole area is greater than a preset ratio, the number of occluded holes is greater than a preset number of occluded holes, and there is a superimposed background.
[0024] In one embodiment, the method further includes:
[0025] Acquire an image of the perforated plate to be identified;
[0026] The image of the perforated plate to be identified is input into the trained perforated plate color recognition model, and the confidence score of the bounding box of each smallest labeled unit in the image of the perforated plate to be identified is output.
[0027] For each of the minimum labeled units, if there are multiple confidence levels and all of the multiple confidence levels are greater than or equal to a preset threshold, then the confidence level with the largest value is determined by non-maximum suppression, and the bounding box and color label corresponding to the confidence level with the largest value are output.
[0028] If the confidence level is less than the preset threshold, the bounding box corresponding to the confidence level is discarded.
[0029] Secondly, this application also provides a training sample construction device for multi-well plate color recognition, comprising:
[0030] The acquisition dimension determination module is used to determine multiple sample acquisition dimensions for multi-well plate color recognition; the multiple sample acquisition dimensions include at least color category, multi-well plate posture, multi-well plate occlusion state, and illumination change;
[0031] The sample data acquisition module is used to determine the initial sample image set of the multi-well plate under multiple sample acquisition dimensions according to each of the sample acquisition dimensions and the acquisition parameters corresponding to each of the sample acquisition dimensions.
[0032] The labeling module is used to determine the bounding box of the smallest labeled unit in each initial sample image in the initial sample image set, and determine the color label of the bounding box according to the fill color of the smallest labeled unit to obtain a sample image set with the color label; the fill color is used to characterize the concentration of the detectable in the smallest labeled unit.
[0033] The model training module is used to obtain a perforated plate color recognition model based on YOLOv8.
[0034] The perforated plate color recognition model is trained based on the sample image set until a preset training termination condition is met, resulting in a well-trained perforated plate color recognition model.
[0035] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0036] Determine multiple sample collection dimensions for color recognition of a perforated plate; the multiple sample collection dimensions include at least color category, perforated plate orientation, perforated plate occlusion state, and illumination change;
[0037] According to each of the sample acquisition dimensions and the corresponding acquisition parameters for each of the sample acquisition dimensions, the initial sample image set of the porous plate under multiple sample acquisition dimensions is determined;
[0038] For each initial sample image in the initial sample image set, the bounding box of the smallest labeled unit in each initial sample image is determined, and the color label of the bounding box is determined according to the fill color of the smallest labeled unit, thus obtaining a sample image set with the color label; the fill color is used to characterize the concentration of the detectable in the smallest labeled unit.
[0039] Obtain a multi-well plate color recognition model determined based on YOLOv8;
[0040] The perforated plate color recognition model is trained based on the sample image set until a preset training termination condition is met, resulting in a well-trained perforated plate color recognition model.
[0041] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0042] Determine multiple sample collection dimensions for color recognition of a perforated plate; the multiple sample collection dimensions include at least color category, perforated plate orientation, perforated plate occlusion state, and illumination change;
[0043] According to each of the sample acquisition dimensions and the corresponding acquisition parameters for each of the sample acquisition dimensions, the initial sample image set of the porous plate under multiple sample acquisition dimensions is determined;
[0044] For each initial sample image in the initial sample image set, the bounding box of the smallest labeled unit in each initial sample image is determined, and the color label of the bounding box is determined according to the fill color of the smallest labeled unit, thus obtaining a sample image set with the color label; the fill color is used to characterize the concentration of the detectable in the smallest labeled unit.
[0045] Obtain a multi-well plate color recognition model determined based on YOLOv8;
[0046] The perforated plate color recognition model is trained based on the sample image set until a preset training termination condition is met, resulting in a well-trained perforated plate color recognition model.
[0047] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0048] Determine multiple sample collection dimensions for color recognition of a perforated plate; the multiple sample collection dimensions include at least color category, perforated plate orientation, perforated plate occlusion state, and illumination change;
[0049] According to each of the sample acquisition dimensions and the corresponding acquisition parameters for each of the sample acquisition dimensions, the initial sample image set of the porous plate under multiple sample acquisition dimensions is determined;
[0050] For each initial sample image in the initial sample image set, the bounding box of the smallest labeled unit in each initial sample image is determined, and the color label of the bounding box is determined according to the fill color of the smallest labeled unit, thus obtaining a sample image set with the color label; the fill color is used to characterize the concentration of the detectable in the smallest labeled unit.
[0051] Obtain a multi-well plate color recognition model determined based on YOLOv8;
[0052] The perforated plate color recognition model is trained based on the sample image set until a preset training termination condition is met, resulting in a well-trained perforated plate color recognition model.
[0053] The aforementioned method, apparatus, computer equipment, computer-readable storage medium, and computer program product for constructing training samples for multi-well plate color recognition, by determining multiple sample acquisition dimensions for multi-well plate color, acquiring images including multiple color categories, multi-well plate posture, multi-well plate occlusion state, and illumination changes, constructs an initial sample image set. For each initial sample image in the initial sample image set, the bounding box of the smallest labeled unit in each initial sample image is determined. The bounding box is labeled according to the fill concentration used to characterize the concentration of the detected substance in the smallest labeled unit to obtain the corresponding color label, resulting in a sample image set for training the multi-well plate color recognition model. This training sample construction method enriches the sample types by determining samples containing different color categories, postures, occlusion states, and illumination changes, and accurately labels each multi-well plate instance using bounding boxes. It uses color as the category label to construct samples for model training. Compared with the traditional method of color recognition by manual visual inspection or spectral analysis, this method has higher accuracy. Moreover, this method uses the concentration of the detected substance as a label for training and enriches the samples according to the determined multiple sample acquisition dimensions. The multi-well plate color recognition model can directly read the concentration of the sample to be tested, realizing end-to-end detection. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a flowchart illustrating a method for constructing training samples for color recognition using a multi-well plate in one embodiment.
[0056] Figure 2 This is a flowchart illustrating step 108 in one embodiment;
[0057] Figure 3 This is a schematic diagram illustrating the training effect of a perforated plate color recognition model in one embodiment;
[0058] Figure 4 This is a schematic diagram showing the color classification accuracy of a perforated plate color recognition model in one embodiment;
[0059] Figure 5 This is a flowchart illustrating a perforated plate color recognition method in one embodiment;
[0060] Figure 6 This is a schematic diagram of the detection effect in one embodiment;
[0061] Figure 7This is a structural block diagram of a training sample construction device for multi-well plate color recognition in one embodiment;
[0062] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0064] Traditional perforated plate color classification relies on manual visual inspection or spectral analysis, which is inefficient and struggles to handle overlapping / occluded objects. Conventional image classification algorithms cannot simultaneously achieve localization and multi-object recognition, and they are ill-suited to handling the distorted color features of densely distributed perforated plates made of transparent / semi-transparent materials under complex lighting conditions. Therefore, a training sample construction method for perforated plate color recognition needs to be proposed to improve its accuracy.
[0065] In one embodiment, such as Figure 1 As shown, a method for constructing training samples for color recognition using a multi-well plate is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0066] Step 102: Determine multiple sample collection dimensions for multi-well plate color recognition; the multiple sample collection dimensions include at least color category, multi-well plate orientation, multi-well plate occlusion state, and illumination change.
[0067] Multiwell plates are a common laboratory consumable. Examples include 96-well and 384-well plates, with each well holding different samples such as cell culture media and chemical reagents. For instance, during experiments, samples in different wells may exhibit different colors due to chemical or biological reactions. Multiwell plate color recognition refers to the automated detection of the color of each well in a multiwell plate during laboratory or industrial testing. By identifying the color of each well, the concentration of the analyte in that well can be determined. Multiwell plates can be made of transparent or translucent materials.
[0068] The acquisition parameters corresponding to color categories should at least include red, orange-red, orange, yellow-orange, yellow, yellow-green, blue, blue-violet, purple, and red-violet in color detection. For image acquisition, each color category should have at least 150 basic sample images. The acquisition parameters corresponding to the perforated plate posture should at least include postures simulating the placement deviation of the detection stage, including three postures: horizontal placement, tilted at +15°, and tilted at -15°. The acquisition parameters corresponding to the perforated plate occlusion state should at least include multiple preset occlusion states, including controlling the single-hole occlusion rate to ≤20%, using opaque occluders to simulate stains / foreign objects, and setting overlapping scenes for the perforated parts, with the overlap area ≤10% of the single-hole area. The acquisition parameters corresponding to illumination changes should at least include different industrial / laboratory lighting environments, including strong light, weak light, sidelight, backlight, natural light fluctuations, and artificial light source angle changes. Strong light and weak light can be defined according to the actual scene; their definitions are not elaborated here.
[0069] Step 104: Determine the initial sample image set of the multi-well plate under multiple sample acquisition dimensions according to each sample acquisition dimension and the corresponding acquisition parameters.
[0070] The initial sample image set includes dimensional features across four dimensions: color category, perforated plate orientation, perforated plate occlusion status, and illumination variation. For example, in initial sample image A, the first three rows of holes in the perforated plate are red, the middle three rows are blue, and the last three rows are green. In this initial sample image A, the perforated plate is horizontally positioned, with a single hole occlusion rate ≤20%, and it is located in a strongly lit scene.
[0071] For example, a perforated plate is fixed to an adjustable stage, and n sets (e.g., 3 sets) of independently controllable LED light sources (corresponding to the top, left, and right lighting directions, respectively) are arranged around it. The background can be replaced with five real-world scene backgrounds, such as a laboratory tabletop (gray texture) and a production line conveyor belt (black / silver). Images are collected in a hierarchical order of "color category → perforated plate posture → occlusion → lighting" to determine the initial sample image set of the perforated plate across multiple sample collection dimensions. The generated initial sample image set is stored in a sample storage folder according to a pre-stored path. The number of sample images in each sample collection dimension should avoid redundancy in single-scene samples. Furthermore, in the case of obtaining an initial sample image set, the image sharpness of the acquired images can be detected in real time during the acquisition process. For example, invalid images that are blurry (e.g., pixel blur > 5%), overexposed (e.g., the percentage of pixels with a brightness value > 240 > 10%) or underexposed (e.g., the percentage of pixels with a brightness value < 20 > 10%) can be removed. Finally, valid samples are selected to obtain the initial sample image set. The number of valid samples can be, but is not limited to, 2000 images.
[0072] Step 106: For each initial sample image in the initial sample image set, determine the bounding box of the smallest labeled unit in each initial sample image, and determine the color label of the bounding box according to the fill color of the smallest labeled unit to obtain a sample image set with color labels; the fill color is used to characterize the concentration of the detectable in the smallest labeled unit.
[0073] The smallest labeled unit can be the smallest structural unit in the initial sample image that can independently perform color recognition and density mapping, typically corresponding to a single well in a multi-well plate. For example, the smallest labeled unit can be used as the basic granularity for color recognition, and the smallest labeled unit can be one or more of the following, including but not limited to circular microwell units, square microwell units, and irregularly shaped microwell units.
[0074] The fill color can be the actual visual color presented within the smallest labeled unit, determined by the concentration of the analyte. The concentration of the analyte can be the content level of the substance to be measured in the micropores of the multi-well plate, which is reflected as a specific color through a colorimetric reaction. The fill color can be used as the basis for generating color labels, establishing a mapping relationship between color and concentration. The sample image set with color labels can be a training image dataset that has already completed bounding box annotation and color label assignment.
[0075] For example, for each initial sample image in the initial sample image set, the bounding box of the smallest labeled unit in each initial sample image is determined. This can be done by locating the micropore region in each image and generating a bounding box surrounding each smallest labeled unit. The color label of the bounding box is determined based on the fill color of the smallest labeled unit, resulting in a sample image set with color labels.
[0076] For example, in an exemplary embodiment, the annotation tool and environment can be prepared first, i.e., the annotation tool is installed and the annotation environment is configured: the default image opening path is set to the sample storage folder, the default annotation format is output as XML (compatible with YOLOv8 training data format), and the label preset list imports the color names corresponding to the color categories in the acquisition parameters. The format can be "detection well - [color]" and "blank well - white" labels (covering the unfilled areas of the multi-well plate). For each initial sample image in the initial sample image set, the bounding box of the smallest annotation unit is generated using the "single well" of the multi-well plate as the smallest annotation unit. This can be done, but is not limited to, automatically fitting the microwell position and generating the bounding box based on the template matching algorithm or having a manual annotator draw the bounding box well by well using a graphical interface tool. Taking the manual annotator drawing the bounding box well by well using a graphical interface tool as an example, a rectangular bounding box is drawn by dragging the mouse: the bounding box must be close to the edge of the well, ensuring that the well area is completely contained within the box, and there is no extra background inside the box (the pixel deviation between the bounding box and the edge of the well is ≤2 pixels). Select the corresponding label for each bounding box: if the hole is filled with the target color, select "Detection Hole - [color]"; if the hole is blank (unfilled), select "Blank Hole - White". After annotation, save the XML file with the same filename as the corresponding sample image (e.g., "sample_001.jpg" corresponds to "sample_001.xml"). This XML file must contain key information such as image size (width / height / depth), bounding box coordinates (xmin / ymin / xmax / ymax), and label name (name).
[0077] Step 108: Obtain the multi-hole plate color recognition model determined based on YOLOv8.
[0078] YOLOv8 can be a real-time object detection deep learning architecture that supports end-to-end training and inference. For example, YOLOv8 can be used as the foundational framework for a perforated plate color recognition model, enabling efficient local feature extraction and color classification. Optionally, YOLOv8 adopts an enhanced version of CSPDarknet (similar to YOLOv5 / YOLOv7), but further optimizes gradient flow and computational efficiency, introducing a deeper cross-stage partial connection (CSP) structure. SPPF (Spatial Pyramid Pooling Fast) is used instead of SPP to accelerate multi-scale feature fusion. The PAN-FPN (Path Aggregation Network) structure is retained, but the hierarchical connection method is adjusted to improve multi-scale object detection capabilities. The perforated plate color recognition model can be built based on the YOLOv8 architecture.
[0079] For example, based on YOLOv8, the nc parameter, which represents the number of target categories the model needs to detect, is modified in YOLOv8 to adapt to the total number of color categories to be identified. Transfer learning is used to initialize the model weights, thus determining the multi-well plate color recognition model to be trained. The relevant training parameters in the multi-well plate color recognition model to be trained include the batch size and the learning rate. The batch size is adaptively adjusted based on the GPU memory, and the learning rate can be determined using a cosine annealing strategy (0.01→0.001).
[0080] Step 110: Train the perforated plate color recognition model based on the sample image set until the preset training termination condition is met, and obtain the trained perforated plate color recognition model.
[0081] The preset training termination condition can be a criterion used during model training to determine whether to terminate the training. For example, the preset training termination condition can include, but is not limited to, one or more of the following: validation set loss stabilization threshold, maximum number of training epochs, accuracy detection, etc. The trained multi-well plate color recognition model can be used to accurately and automatically identify the color of the micropores in a multi-well plate in real-world scenarios.
[0082] Training a multi-well plate color recognition model using a sample image set can be, but is not limited to, inputting a set of color-labeled sample images into the model and optimizing the network parameters through backpropagation. This allows the model to learn to accurately identify the color of microwells under complex interference. For example, in a high-throughput drug screening experiment, the trained model can accurately identify the color filled in each well and map it to the corresponding drug activity concentration level.
[0083] The above-mentioned training sample construction method for multi-well plate color recognition determines multiple sample acquisition dimensions for multi-well plate color recognition, establishes an initial sample image set according to each sample acquisition dimension and its corresponding acquisition parameters, determines the bounding box of the smallest labeled unit for the initial sample images, and determines color labels based on the fill color to obtain a sample image set with color labels. A multi-well plate color recognition model based on YOLOv8 is then obtained, and the model is trained based on the sample image set until the preset training termination conditions are met. By introducing four acquisition dimensions—color type category, multi-well plate pose, occlusion state, and illumination change—in the sample construction stage, sufficient diversity of training data is ensured. Using the smallest labeled unit as the basic recognition granularity and its fill color, color labels with concentration semantics are generated, enabling the model to associate color with the concentration of the detected substance. The YOLOv8 architecture is used to achieve integrated training for precise micro-well region localization and color classification. This method can achieve accurate, stable, and automated recognition of the color of multi-well plate micropores in complex scenarios such as biological experiments, industrial quality inspection, and environmental monitoring, with higher accuracy compared to traditional methods such as manual visual inspection or spectral analysis.
[0084] In one exemplary embodiment, such as Figure 2 As shown, step 108 includes steps 202 to 206. Wherein:
[0085] Step 202: Divide the sample image set according to color category to obtain multiple sample image subsets.
[0086] If all sample images in the sample image set are a single color, the sample image set can be directly divided according to color category to obtain multiple sample image subsets. If each sample image in the sample image set contains at least two colors, the sample images are first segmented according to color. The resulting sub-sample images containing only a single color are then divided according to color category to obtain multiple sample image subsets. For example, using a "hierarchical random partitioning" strategy: 2000 samples are divided into 12 groups according to color category, resulting in 12 sample image subsets.
[0087] Step 204: Divide each subset of sample images according to a preset ratio to obtain a sample image training set, a sample image test set, and a sample image verification set; wherein the sample image training set, sample image test set, and sample image verification set each include sample images corresponding to multiple sample collection dimensions.
[0088] The preset proportions can be, but are not limited to, a 70% training set, 15% validation set, and 15% test set ratio. The sample image training set, sample image test set, and sample image validation set each include sample images corresponding to multiple sample collection dimensions. This can be understood as covering multiple colors corresponding to color categories, all poses corresponding to perforated plate poses, all occlusion states corresponding to perforated plate occlusion states, and all lighting scenarios corresponding to lighting changes. For example, if the color categories include 12 colors, the perforated plate poses include 3 poses, and the lighting changes include 8 lighting scenarios, then the sample image training set, sample image test set, and sample image validation set also cover 12 colors, 3 poses, and 8 lighting scenarios. Optionally, each subset of sample images can be divided according to a preset ratio to obtain a training set, a test set, and a validation set. A list of image paths for the training set / validation set / test set (in txt file format) can be generated using a Python script. Each line in the image path list records the absolute path of a single sample (e.g., " / data / sample_001.jpg"), ensuring that the corresponding sample and XML annotation file can be directly read during model training.
[0089] Furthermore, in an exemplary embodiment, the sample image test set includes at least extreme interference samples used to accurately evaluate the generalization ability of the perforated plate color recognition model. These extreme interference samples include test sample images where the proportion of reflective pixels in the perforated area is greater than a preset ratio, the number of obscured holes is greater than a preset number of obscured holes, and there is a superimposed background. For example, in 15% of the sample image test set, 10% are "extreme interference samples." These samples must include extreme scenarios such as strong reflection (e.g., the proportion of reflective pixels in the perforated area > a preset ratio (e.g., 30%)), multi-hole obscuration (the number of obscured holes ≥ a preset number of obscured holes (e.g., 3)), and superimposed backgrounds such as complex backgrounds (superimposed backgrounds of laboratory countertop stains / production line metal debris), used to accurately evaluate the model's generalization ability.
[0090] Step 206: Train the perforated plate color recognition model based on the sample image training set, sample image test set, and sample image verification set until the preset training termination condition is met, and obtain the trained perforated plate color recognition model.
[0091] For example, the perforated plate color recognition model is trained using a training set, a test set, and a validation set of sample images. This can involve inputting the training set into the model for forward propagation and parameter updates, periodically evaluating performance on the validation set, and finally reporting the results on the test set. Furthermore, this operation can establish a standardized training process, allowing the model to learn and validate its generalization ability under controlled conditions. The trained perforated plate color recognition model is obtained until a preset training termination condition is met. This can be a continuous iterative training process, terminating training and saving the optimal model when the validation set metrics reach a preset threshold. Furthermore, after obtaining the trained perforated plate color recognition model, it can be exported to TensorRT format, enabling model migration and deployment across different frameworks and hardware platforms, for example, achieving real-time detection of ≥25 FPS on embedded devices.
[0092] In the above embodiments, the sample image set is divided into multiple sample image subsets according to color categories. Each sample image subset is further divided into a sample image training set, a sample image test set, and a sample image verification set according to a preset ratio. The sample image training set, sample image test set, and sample image verification set all cover the same scene, which can maintain the class balance in the three datasets and prevent overfitting during model training. This can effectively avoid overfitting or underfitting of the model caused by color category imbalance or sampling dimension distribution shift, so that the perforated plate color recognition model can still stably and accurately identify the color of micropores when facing real complex scenes, thereby improving the accuracy of perforated plate color recognition.
[0093] It is understandable that, in order to further improve the accuracy of the perforated plate color recognition model, the training sample data can be augmented in the early stages of model training. In an exemplary embodiment, the perforated plate color recognition model is trained based on a sample image training set, a sample image test set, and a sample image validation set until a preset training termination condition is met, resulting in a trained perforated plate color recognition model, including:
[0094] The sample image training set is augmented to obtain an augmented sample image training set. Based on the augmented sample image training set, sample image test set, and sample image verification set, the perforated plate color recognition model is trained until the preset training termination condition is met, and the trained perforated plate color recognition model is obtained.
[0095] Among these methods, enhancement processing can be used to improve the diversity and robustness of training data, enabling the model to learn perturbation-invariant color semantic features even with limited real-world samples. Enhancement processing can introduce controllable perturbations such as pose, lighting, or occlusion into each training image while maintaining the original color labels. Furthermore, enhancement processing can include, but is not limited to, one or more of geometric transformation enhancement, lighting simulation enhancement, and occlusion simulation enhancement. In an exemplary embodiment, enhancement processing includes at least one of random brightness adjustment, affine transformation, simulated occlusion, and background replacement. Enhancement processing can be based on the PyTorch Albumentations library, configuring dynamic enhancement strategies in the DataLoader stage of model training. Enhancement operations only apply to training set samples to avoid affecting evaluation accuracy; validation and test set samples are not enhanced. In an exemplary embodiment, such as... Figure 3The diagram shows the training performance of the multi-hole plate color recognition model, including the performance of each metric. These metrics include: bounding box loss (train / box_loss), classification loss (train / cls_loss), focal distribution loss (train / dfl_loss), recall (metrics / recall(B)), precision (metrics / precision(B)), mean precision (metrics / mAP50(B)), mean precision (metrics / mAP50-95(B)) of bounding box detection at a series of thresholds with IoU values from 0.5 to 0.95 in steps of 0.05, bounding box loss (val / box_loss) on the validation set, classification loss (val / cls_loss) on the validation set, and focal distribution loss (val / dfl_loss) on the validation set. Furthermore, at a single IoU threshold (e.g., 0.5), the average precision (AP) is calculated for all categories, and then the average precision (mAP) is calculated for all categories. This is a core metric for measuring detection performance, and a higher value is better. Here, IoU=0.5 is a relatively lenient standard. In the effect diagram corresponding to each metric, the horizontal axis represents the number of iterations, and the vertical axis represents the precision.
[0096] In one exemplary embodiment, such as Figure 4 The diagram shows the color classification accuracy of the multi-well plate color recognition model. The horizontal axis represents the true color, and the vertical axis represents the predicted color. The color can be represented by concentration, such as 1pM, 10pM, 100pM, 500pM, 1nM, 10nM, 100nM, 500nM. The background can be a pure background. The value 1 indicates that the true color and the predicted color are consistent.
[0097] In one exemplary embodiment, enhancing the sample image training set to obtain an enhanced sample image training set can include the following:
[0098] Scenario 1: Obtain randomly generated brightness adjustment coefficients, and perform random brightness adjustment on the training sample images in the training image training set according to the brightness adjustment coefficients to obtain an enhanced training set of sample images that includes color changes under different light intensities.
[0099] The randomly generated brightness adjustment coefficient can be generated, but is not limited to, by calling the RandomBrightnessContrast function. For example, by calling the RandomBrightnessContrast function and setting the image brightness adjustment range brightness_range=(-0.3,0.3), the brightness adjustment coefficient is randomly generated each time the training sample is read. The range of the brightness adjustment coefficient can be 0.7-1.3, thereby simulating color changes under different light intensities.
[0100] Scenario 2: Obtain the perforated plate posture adjustment parameters, and perform affine transformations on the training sample images in the sample image training set according to the perforated plate posture adjustment parameters to obtain an enhanced sample image training set including various perforated plate postures.
[0101] The perforated plate attitude adjustment parameters can include random rotation angle, random scaling factor, maintaining image aspect ratio, and preset edge fill color. Random rotation angle simulates different rotation scenarios that the perforated plate might encounter in real-world scenes, rotating the perforated plate image at random angles. Random scaling simulates images of the perforated plate taken at different distances, allowing the model to adapt to perforated plates of different sizes and enhancing its generalization ability. Maintaining the image aspect ratio ensures that the shape of the perforated plate remains unchanged during processing, enabling the model to accurately identify the perforated plate's features. Preset edge fill color maintains a consistent format and appearance in the processed image, preventing blank areas from interfering with subsequent analysis.
[0102] For example, by calling the Affine function, setting the random rotation angle of the perforated plate to rotate=(-15,15) (random rotation ±15°) and the random scaling factor to scale=(0.8,1.2) (i.e., random scaling from 0.8 to 1.2 times), and simultaneously enabling keep_ratio=True (maintaining the image aspect ratio) and border_mode=1 (filling the edges with black), it is possible to adapt to the posture deviation of the perforated plate.
[0103] For example, by setting random rotation angles, random scaling factors, maintaining image aspect ratio and edge fill color, affine transformations can be performed on training sample images in the sample image training set to simulate the pose deviations that may occur in a real-world scenario for a perforated plate, thereby obtaining an enhanced sample image training set including various perforated plate poses.
[0104] Scenario 3: Obtain simulated occlusion parameters, and simulate occlusion on the training sample images in the sample image training set according to the simulated occlusion parameters to obtain an enhanced sample image training set including different occlusion situations.
[0105] The simulated occlusion parameters can include the maximum number of holes that can be occluded in a single operation, hole height, hole width, and the color of the occluded area. The maximum number of holes that can be occluded in a single simulated occlusion operation refers to the maximum number of holes that can be occluded in one operation, used to characterize and control the degree of occlusion, simulating different levels of occlusion to test the model's performance under different occlusion levels. Hole height and hole width represent the height and width of a single hole on the porous plate in the image, respectively, determining the specific size and position of each hole in the image for accurate occlusion. The color of the occluded area can be, but is not limited to, white, simulating the color of common foreign objects.
[0106] For example, for each training sample image in the sample image training set, the number of holes to be occluded in this simulation is determined, and the holes to be occluded are randomly selected. Based on the hole height and hole width, the positions of these holes are found in the image. The areas of these holes are covered using a specified occlusion area color to complete the occlusion simulation. This can yield an enhanced sample image training set including different occlusion scenarios. For example, the CoarseDropout function can be called, setting max_holes=1 (maximum of occlusion per hole), max_height=0.2 hole height, max_width=0.2 hole width (ensuring occlusion rate ≤20%), and dropout_fill_value=255 (the occluded area is filled with white, simulating the color of common foreign objects).
[0107] Scenario 4: Obtain a pre-constructed real-scene background image library, embed the training sample images in the sample image training set into randomly determined target background images, and obtain an enhanced sample image training set including different target background images; the target background images are determined from the real-scene background image library.
[0108] The library of real-world background images includes at least laboratory benchtops and production line conveyor belts.
[0109] For example, the RandomSizedCropAndPad function is called to determine a randomly selected target background image from a pre-built library of real-world background images. The training sample images in the sample image training set are embedded into the randomly selected target background image at their original proportions. The embedding position is random (to ensure background diversity). After embedding, the image size is uniformly resized to match the input size of the perforated plate color recognition model. For example, it is uniformly resized to 640×640 to match the input size of the perforated plate color recognition model determined based on YOLOv8.
[0110] It should be noted that the enhancement processing methods described above can be applied to each image in the sample image training set using one or more enhancement processing methods. For example, at least one of random brightness adjustment, affine transformation, simulated occlusion, and background replacement can be applied to each image in the sample image training set. The specific implementation methods will not be elaborated here.
[0111] In the above embodiments, one or more image enhancement techniques can be applied to each image in the sample image training set while keeping the original color labels unchanged. This can enrich the amount of training data without increasing the actual acquisition cost and improve the model's adaptability to complex real-world imaging conditions. By training the multi-hole plate color recognition model using the enhanced sample image training set, sample image test set, and sample image verification set, the robustness of the model's detection can be further improved.
[0112] In one exemplary embodiment, a method for color recognition of a perforated plate is provided, such as... Figure 5 As shown, it includes the following steps:
[0113] Step 502: Obtain the image of the porous plate to be identified.
[0114] The image of the porous plate to be identified can be an image of a porous plate containing microparticles of different drug carriers, an image of a porous plate containing the color of microspheres on a production line, or an image of a porous plate containing pollutants in water.
[0115] Step 504: Input the image of the perforated plate to be identified into the trained perforated plate color recognition model, and output the confidence score of the bounding box of each smallest labeled unit in the image of the perforated plate to be identified.
[0116] The trained perforated plate color recognition model can be determined using the method described above, and will not be repeated here. The smallest labeled unit can be a single hole in the perforated plate in the image of the perforated plate to be recognized.
[0117] Step 506: For each smallest labeled unit, if there are multiple confidence levels and all of them are greater than or equal to a preset threshold, then the confidence level with the largest value is determined by non-maximum suppression, and the bounding box and color label corresponding to the confidence level with the largest value are output.
[0118] Step 508: If the confidence level is less than the preset threshold, discard the bounding box corresponding to the confidence level.
[0119] In one exemplary embodiment, such as Figure 6 The image shows a schematic diagram of the detection results, including the bounding box and color labels. The color labels represent the concentration of the analyte, with NC 0.93 indicating a blank well. Figure 6The different concentrations shown represent different colors. Table 1 presents a comparison of the color recognition performance of the multi-well plate in this embodiment with that of traditional methods.
[0120] Table 1
[0121]
[0122] Wherein, mAP@0.5 refers to the average accuracy of the model across all categories when the IoU threshold is set to 0.5. As can be seen from the data in Table 1, the detection performance of the perforated plate color recognition in this embodiment is better than that of the traditional method.
[0123] In the above embodiments, by constructing samples containing different color categories, poses, occlusion states, and illumination changes, and by precisely labeling each well plate instance with a rectangular bounding box, and by directly using the concentration of the detected substance as a label for training, a trained well plate color recognition model is obtained. By using this trained well plate color recognition model to perform color recognition on each well in the image of the well plate to be identified, the concentration of the actual detected substance in each well can be accurately determined. Moreover, it can avoid the problem of low detection accuracy caused by the easy distortion of color features of the well plate under complex illumination.
[0124] In an exemplary embodiment, multiple sample acquisition dimensions for multi-well plate color recognition are determined; these multiple sample acquisition dimensions include at least color category, multi-well plate orientation, multi-well plate occlusion state, and illumination variation; according to each sample acquisition dimension and its corresponding acquisition parameters, an initial sample image set for the multi-well plate under multiple sample acquisition dimensions is determined; for each initial sample image in the initial sample image set, the bounding box of the smallest labeled unit in each initial sample image is determined, and the color label of the bounding box is determined based on the fill color of the smallest labeled unit, resulting in a sample image set with color labels; the fill color is used to characterize the concentration of the detectable substance in the smallest labeled unit; and a multi-well plate color recognition model determined based on YOLOv8 is obtained.
[0125] The sample image set is divided according to color category to obtain multiple sample image subsets. Each sample image subset is further divided according to a preset ratio to obtain a sample image training set, a sample image test set, and a sample image validation set. Each of the sample image training set, sample image test set, and sample image validation set includes sample images corresponding to multiple sample collection dimensions. The sample image training set is enhanced to obtain an enhanced sample image training set. The multi-hole plate color recognition model is trained based on the enhanced sample image training set, sample image test set, and sample image validation set until a preset training termination condition is met, resulting in a trained multi-hole plate color recognition model.
[0126] Acquire an image of the perforated plate to be identified; input the image of the perforated plate to be identified into the trained perforated plate color recognition model, and output the bounding box and color label of each hole in the image of the perforated plate to be identified.
[0127] It should be noted that the specific implementation method in this embodiment can be implemented in the manner described above, and will not be repeated here.
[0128] In the above embodiments, by constructing a porous plate image dataset containing different color categories, poses, occlusion states, and illumination changes, and by determining the concentration of the detected substance as a color label, the model is trained. The model can directly read the concentration of the sample to be tested, realizing end-to-end detection. By constructing sample images containing different color categories, poses, occlusion states, and illumination changes, and by performing enhancement processing on the images in the sample image training set through random brightness adjustment, affine transformation, simulated occlusion, and background replacement, the problem of color feature distortion of porous plates under complex illumination can be avoided, as well as the false detection of the background during the detection process can be avoided, thus improving the accuracy of detection.
[0129] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0130] Based on the same inventive concept, this application also provides a training sample construction apparatus for multi-well plate color recognition to implement the training sample construction method for multi-well plate color recognition described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method. Therefore, the specific limitations in one or more embodiments of the training sample construction apparatus for multi-well plate color recognition provided below can be found in the limitations of the training sample construction method for multi-well plate color recognition described above, and will not be repeated here.
[0131] In one exemplary embodiment, such as Figure 7 As shown, a training sample construction device for multi-well plate color recognition is provided, including: a data acquisition dimension determination module 702, a sample data acquisition module 704, a labeling module 706, and a model training module 708, wherein:
[0132] The acquisition dimension determination module 702 is used to determine multiple sample acquisition dimensions for multi-well plate color recognition; the multiple sample acquisition dimensions include at least color category, multi-well plate posture, multi-well plate occlusion state, and illumination change.
[0133] The sample data acquisition module 704 is used to determine the initial sample image set of the multi-well plate under multiple sample acquisition dimensions according to each sample acquisition dimension and the corresponding acquisition parameters.
[0134] The labeling module 706 is used to determine the bounding box of the smallest labeled unit in each initial sample image in the initial sample image set, and to determine the color label of the bounding box according to the fill color of the smallest labeled unit, so as to obtain a sample image set with color labels; the fill color is used to characterize the concentration of the detectable in the smallest labeled unit.
[0135] The model training module 708 is used to obtain a perforated plate color recognition model determined based on YOLOv8; the perforated plate color recognition model is trained according to the sample image set until the preset training termination condition is met, and the trained perforated plate color recognition model is obtained.
[0136] The aforementioned training sample construction device for multi-well plate color recognition constructs an initial sample image set by determining multiple sample acquisition dimensions for multi-well plate color, acquiring images including multiple color categories, multi-well plate pose, multi-well plate occlusion state, and illumination changes. For each initial sample image in the initial sample image set, the bounding box of the smallest labeled unit in each initial sample image is determined. The bounding box is labeled according to the fill concentration used to characterize the concentration of the detected substance in the smallest labeled unit to obtain the corresponding color label, thus obtaining the sample image set used to train the multi-well plate color recognition model. This training sample construction method enriches the sample types by determining samples containing different color categories, poses, occlusion states, and illumination changes, and accurately labels each multi-well plate instance with bounding boxes. The model is trained using color as the category label. Compared with the traditional method of color recognition by manual visual inspection or spectral analysis, this method has higher accuracy. Moreover, this method uses the concentration of the detected substance as a label for training and enriches the samples according to the determined multiple sample acquisition dimensions. The multi-well plate color recognition model can directly read the concentration of the sample to be tested, realizing end-to-end detection.
[0137] In an exemplary embodiment, the model training module 708 is used to divide the sample image set according to color category to obtain multiple sample image subsets;
[0138] Each subset of sample images is divided according to a preset ratio to obtain a sample image training set, a sample image test set, and a sample image validation set; each of the sample image training set, sample image test set, and sample image validation set includes sample images corresponding to multiple sample collection dimensions;
[0139] The perforated plate color recognition model is trained using the sample image training set, sample image test set, and sample image verification set until the preset training termination condition is met, resulting in a well-trained perforated plate color recognition model.
[0140] In an exemplary embodiment, the training sample construction device for multi-hole plate color recognition includes a data augmentation module, which is used to augment the training set of sample images to obtain an augmented training set of sample images.
[0141] The model training module 708 is used to train the perforated plate color recognition model based on the enhanced sample image training set, sample image test set, and sample image verification set until the preset training termination condition is met, and the trained perforated plate color recognition model is obtained.
[0142] In an exemplary embodiment, the data augmentation module is used to obtain randomly generated brightness adjustment coefficients, and to perform random brightness adjustment on training sample images in the sample image training set according to the brightness adjustment coefficients, so as to obtain an augmented sample image training set including color changes under different light intensities.
[0143] And / or, obtain the perforated plate posture adjustment parameters, and perform affine transformation on the training sample images in the sample image training set according to the perforated plate posture adjustment parameters to obtain a training set of enhanced sample images including different perforated plate postures.
[0144] And / or, obtain simulated occlusion parameters, and simulate occlusion on the training sample images in the sample image training set according to the simulated occlusion parameters to obtain an enhanced sample image training set including different occlusion situations;
[0145] And / or, obtain a pre-constructed real-scene background image library, embed training sample images from the sample image training set into randomly determined target background images, and obtain an enhanced sample image training set including different target background images; the target background images are determined from the real-scene background image library.
[0146] In an exemplary embodiment, the sample image test set includes at least extreme interference samples for accurately evaluating the genericity capability of the perforated plate color recognition model. The extreme interference samples include at least test sample images where the proportion of reflective pixels in the perforated area is greater than a preset ratio, the number of obscured holes is greater than a preset number of obscured holes, and there is a superimposed background.
[0147] In an exemplary embodiment, the training sample construction device for multi-well plate color recognition further includes a recognition module, which is used to acquire a multi-well plate image to be recognized; input the multi-well plate image to be recognized into a trained multi-well plate color recognition model; and output the confidence score of the bounding box of each smallest labeled unit in the multi-well plate image to be recognized.
[0148] For each smallest labeled unit, if there are multiple confidence levels and all of them are greater than or equal to a preset threshold, then the confidence level with the largest value is determined by non-maximum suppression, and the bounding box and color label corresponding to the confidence level with the largest value are output.
[0149] If the confidence level is less than the preset threshold, the bounding box corresponding to the confidence level is discarded.
[0150] Each module in the aforementioned training sample construction device for multi-well plate color recognition can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0151] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a method for constructing training samples for multi-well plate color recognition. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0152] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0153] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0154] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0155] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0156] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0157] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0158] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0159] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for constructing training samples for color recognition using a multi-well plate, characterized in that, The method includes: Determine multiple sample collection dimensions for color recognition of a perforated plate; the multiple sample collection dimensions include at least color category, perforated plate orientation, perforated plate occlusion state, and illumination change; According to each of the sample acquisition dimensions and the corresponding acquisition parameters for each of the sample acquisition dimensions, the initial sample image set of the porous plate under multiple sample acquisition dimensions is determined; For each initial sample image in the initial sample image set, the bounding box of the smallest labeled unit in each initial sample image is determined, and the color label of the bounding box is determined according to the fill color of the smallest labeled unit, thus obtaining a sample image set with the color label; the fill color is used to characterize the concentration of the detectable in the smallest labeled unit. Obtain a multi-well plate color recognition model determined based on YOLOv8; The perforated plate color recognition model is trained based on the sample image set until a preset training termination condition is met, resulting in a well-trained perforated plate color recognition model.
2. The method according to claim 1, characterized in that, The step of training the perforated plate color recognition model based on the sample image set until a preset training termination condition is met, to obtain a trained perforated plate color recognition model, includes: The sample image set is divided according to color category to obtain multiple sample image subsets; Each subset of sample images is divided according to a preset ratio to obtain a sample image training set, a sample image test set, and a sample image verification set; wherein each of the sample image training set, sample image test set, and sample image verification set includes sample images corresponding to multiple sample acquisition dimensions; The perforated plate color recognition model is trained based on the sample image training set, sample image test set, and sample image verification set until the preset training termination condition is met, thus obtaining the trained perforated plate color recognition model.
3. The method according to claim 2, characterized in that, The step of training the perforated plate color recognition model based on the sample image training set, sample image test set, and sample image verification set until a preset training termination condition is met, thereby obtaining a trained perforated plate color recognition model, includes: The sample image training set is augmented to obtain an augmented sample image training set. The perforated plate color recognition model is trained based on the enhanced sample image training set, sample image test set, and sample image verification set until the preset training termination condition is met, thus obtaining the trained perforated plate color recognition model.
4. The method according to claim 3, characterized in that, The enhancement process includes at least one of random brightness adjustment, affine transformation, simulated occlusion, and background replacement; the enhancement process on the sample image training set to obtain the enhanced sample image training set includes: Obtain randomly generated brightness adjustment coefficients, and perform random brightness adjustment on the training sample images in the sample image training set according to the brightness adjustment coefficients to obtain an enhanced sample image training set including color changes under different light intensities; And / or, obtain the perforated plate posture adjustment parameters, and perform affine transformation on the training sample images in the sample image training set according to the perforated plate posture adjustment parameters to obtain a training set of enhanced sample images including different perforated plate postures. And / or, obtain simulated occlusion parameters, and simulate occlusion on the training sample images in the sample image training set according to the simulated occlusion parameters to obtain an enhanced sample image training set including different occlusion situations; And / or, obtain a pre-constructed real-scene background image library, embed training sample images from the sample image training set into randomly determined target background images, and obtain an enhanced sample image training set including different target background images; the target background images are determined from the real-scene background image library.
5. The method according to claim 2, characterized in that, The sample image test set includes at least extreme interference samples used to accurately evaluate the genericity capability of the perforated plate color recognition model. The extreme interference samples include at least test sample images where the proportion of reflective pixels in the hole area is greater than a preset ratio, the number of occluded holes is greater than a preset number of occluded holes, and there is a superimposed background.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Acquire an image of the perforated plate to be identified; The image of the perforated plate to be identified is input into the trained perforated plate color recognition model, and the confidence score of the bounding box of each smallest labeled unit in the image of the perforated plate to be identified is output. For each of the minimum labeled units, if there are multiple confidence levels and all of the multiple confidence levels are greater than or equal to a preset threshold, then the confidence level with the largest value is determined by non-maximum suppression, and the bounding box and color label corresponding to the confidence level with the largest value are output. If the confidence level is less than the preset threshold, the bounding box corresponding to the confidence level is discarded.
7. A training sample construction device for multi-well plate color recognition, characterized in that, The device includes: The acquisition dimension determination module is used to determine multiple sample acquisition dimensions for multi-well plate color recognition; the multiple sample acquisition dimensions include at least color category, multi-well plate posture, multi-well plate occlusion state, and illumination change; The sample data acquisition module is used to determine the initial sample image set of the multi-well plate under multiple sample acquisition dimensions according to each of the sample acquisition dimensions and the acquisition parameters corresponding to each of the sample acquisition dimensions. The labeling module is used to determine the bounding box of the smallest labeled unit in each initial sample image in the initial sample image set, and determine the color label of the bounding box according to the fill color of the smallest labeled unit to obtain a sample image set with the color label; the fill color is used to characterize the concentration of the detectable in the smallest labeled unit. The model training module is used to obtain a perforated plate color recognition model based on YOLOv8. The perforated plate color recognition model is trained based on the sample image set until a preset training termination condition is met, resulting in a well-trained perforated plate color recognition model.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Shrimp freshness identification method based on organic amine response intelligent indication label
CN118212471A
Color recognition model training method, color recognition method, device and storage medium
CN118570589A