Microplastic detection method and system based on YOLOv11

By fine-tuning the YOLOv11 model and augmenting the dataset, combined with a web-based interactive interface, the accuracy and interactivity issues of microplastic detection in microscopic images were resolved, enabling rapid localization and accurate classification of microplastic targets.

CN121963194APending Publication Date: 2026-05-01SOUTH CHINA INST OF ENVIRONMENTAL SCI MEP
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SOUTH CHINA INST OF ENVIRONMENTAL SCI MEP
Filing Date
2026-01-21
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing technologies for microplastic detection in microscopic images suffer from low accuracy in detecting small targets, uneven category distribution, and poor interactivity of the detection system, making it difficult to achieve efficient and accurate microplastic target identification and quantity statistics.

Method used

The YOLOv11 model was fine-tuned and trained, and combined with dataset augmentation strategies such as local region cropping and synthetic enhancement, to construct a composite category system. The detection results were displayed through a web-based interactive interface, enabling image uploading, result visualization, and quantity statistics.

Benefits of technology

It enables rapid localization, accurate classification, and quantity counting of microplastic targets in microscopic scenarios, improves the visualization and user-friendliness of detection results, and solves the difficulties in detecting small targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121963194A_ABST
    Figure CN121963194A_ABST
Patent Text Reader

Abstract

The invention discloses a microplastic detection method and system based on YOLOv11. The method comprises the following steps: acquiring a microscopic image of a sample through a microscope; performing data annotation on the original image set to generate a data set; performing local region cutting enhancement on the category with extremely small sample size; an improved synthesis enhancement strategy is further adopted; performing model training based on the enhanced data set; image selection and uploading functions are realized based on a front-end page; and the rear end loads a micro-plastic identification model obtained by performing fine tuning training based on a YOLOv11 model through a target detection interface provided by the FastAPI to execute reasoning, and outputs a detection result. The system comprises a data set construction module, a data enhancement module, a model training module and a detection module. By using the method, rapid positioning, accurate classification and quantity statistics of the composite type micro-plastic target in a microscopic scene are realized. The method can be widely applied to the field of environment monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of environmental monitoring, and in particular to a microplastic detection method and system based on YOLOv11. Background Technology

[0002] Microplastic pollution poses a potential risk to ecosystems and human health. To address this issue, methods for detecting microplastics have received widespread attention globally. Traditional detection methods rely on manual identification or spectroscopic analysis, which suffer from low efficiency, high subjectivity, and difficulty in large-scale implementation.

[0003] Furthermore, due to the rapid development of deep learning detection models, corresponding deep learning object detection technologies can automatically extract features and achieve end-to-end detection. However, microplastic targets are often tiny in size, and traditional object detection algorithms still face challenges in handling small targets in microscopic image scenarios: due to the loss of detailed information caused by feature map downsampling, the features of tiny targets are not significant, easily leading to missed detections and false detections. In other words, existing deep learning detection methods still have insufficient adaptability in the detection of small targets in microscopic images. In addition, existing systems often lack user-friendly interactive interfaces, making it difficult to deploy quickly in non-professional environments. Therefore, there is an urgent need for a system that integrates high-performance detection algorithms with web-based interaction to achieve an integrated workflow of "acquisition—detection—export—statistics". Summary of the Invention

[0004] In view of this, in order to solve the technical problem that existing detection methods are not suitable for small targets in microscopic images, thus leading to low detection accuracy, firstly, this invention proposes a microplastic detection method based on YOLOv11, which includes the following steps: First, microscopic images of samples are acquired using a microscope to obtain an original image set containing microplastic targets of various shapes and colors. The original image set is then labeled, and a composite category system is constructed according to shape (fiber, film, fragment, particle) and color (blue, black, transparent, white, green) to generate a dataset. Addressing the characteristics of "class imbalance" and "high proportion of small targets" in microscopic scenes, the following enhancement and resampling mechanisms are introduced: local region cropping enhancement is performed on categories with sample sizes below a preset threshold (e.g., less than 50 samples); further, improved synthesis enhancement strategies (e.g., copy-paste synthesis, random scaling and random position pasting, and introducing transparency fusion to simulate the imaging characteristics of transparent microplastics) are employed to improve the learnability of small targets and categories with few samples; simultaneously, oversampling or category weight-based sampling strategies are used to alleviate class imbalance. Based on the enhanced dataset, the model is fine-tuned and trained to obtain a microplastic recognition model. Image selection and uploading functions are implemented on the front-end page, and the back-end uses the target detection interface provided by FastAPI to load the microplastic recognition model for inference, returning a JSON structure containing category, confidence score, and bounding box coordinates. The system also provides a visual display and statistical analysis of the detection results on the front end, and supports exporting the results as labeled images and / or tabular files.

[0005] In addition to the above method, the present invention also proposes a microplastic detection system based on YOLOv11. The system includes a dataset construction module, a data augmentation module, a model training module, and a detection module. The detection module is used to provide an interactive web-based detection interface to realize image uploading, result display, quantity statistics, and export.

[0006] Based on the above scheme, this invention provides a microplastic detection method and system based on YOLOv11. By constructing targeted data augmentation and sample balancing mechanisms, and combining a microplastic recognition model finely trained based on the YOLOv11 model, it achieves rapid localization, accurate classification, and quantity statistics of composite microplastic targets in microscopic scenes. At the same time, it combines an interactive web-based detection interface to improve the visualization and user-friendliness of the detection results, thereby solving the detection difficulties of small target size, unbalanced categories, weak color differences, and high transparency in microscopic microplastic images. Attached Figure Description

[0007] Figure 1 This is a flowchart of the steps of a microplastic detection method based on YOLOv11 according to the present invention; Figure 2 This is a schematic diagram of the input image in a specific embodiment of the present invention; Figure 3 This is a schematic diagram of the detection results using the detection method of the present invention. Detailed Implementation

[0008] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0009] It should 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 application can be combined with each other.

[0010] It should be understood that the terms "system," "apparatus," "unit," and / or "module" used in this application are a method of distinguishing different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.

[0011] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "a," and / or "the" are not specifically singular and may include the plural. Generally, the terms "comprising" and "including" only indicate the inclusion of expressly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements. An element defined by the phrase "comprising an..." does not exclude the presence of other identical elements in the process, method, product, or apparatus that includes the element.

[0012] In the description of the embodiments of this application, "a plurality of" refers to two or more. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.

[0013] Furthermore, flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed precisely in sequence. Instead, the steps can be processed in reverse order or simultaneously. Additionally, other operations can be added to these processes, or one or more steps can be removed from them.

[0014] Reference Figure 1 This is a schematic flowchart of an optional example of the microplastic detection method based on YOLOv11 proposed in this invention. This method can be applied to computer devices, and the detection method proposed in this embodiment may include, but is not limited to, the following steps: Step S1: Acquire microscopic images and construct a dataset; Step S2: Perform local region cropping enhancement processing, synthesis enhancement processing, and category resampling processing on the dataset; Step S3: Fine-tune the YOLOv11 model based on the enhanced dataset to obtain the microplastic recognition model; Step S4: Input the microscopic sample to be tested into the microplastic recognition model, output the detection results, and support result visualization, quantity statistics and export.

[0015] In some feasible embodiments, it also includes: Set up a front-end page for users to upload images, and load the trained detection model on the back-end.

[0016] The front-end module is built on HTML / CSS / JavaScript and supports enhanced interactive functions such as image uploading, visualization, tabular display of detection results, zoom-in viewing of local areas, transparency filtering, and grouping display by morphology clustering.

[0017] The front-end interface supports: image upload, transparency filtering (only transparent microplastics are displayed), morphology clustering display (grouped by fiber / film / fragment), local magnification and roaming of small targets, and synchronized linkage between detection result highlighting and table.

[0018] The backend module is based on FastAPI and implements the object detection interface: receiving uploaded images, performing model inference, and outputting structured detection results in JSON format.

[0019] The model inference module loads the YOLOv11 microplastic detection model trained by the method of this invention, and returns the category (including the composite category name), confidence score, center coordinates (x, y), width w, height h, and optional target orientation angle for each detected target.

[0020] The statistical analysis module performs quantitative statistics, category proportion analysis, and transparency distribution statistics on the inference results, and can generate multi-dimensional statistical reports by composite categories.

[0021] In some feasible embodiments, step S1 specifically includes: S1.1 Obtain microscopic images of water bodies, soil and experimental samples from different sources using a microscope to obtain a raw image set containing microplastic targets of various shapes and colors.

[0022] S1.2. Use rectangular boxes to label microplastic targets and construct a composite category system according to morphology (fiber, film, fragment, particle) and color (blue, black, transparent, white, green). The category labeling format meets the training specifications of the YOLO series models.

[0023] This embodiment uses microscope images for target annotation, and the annotation format conforms to the relative coordinate specifications of the YOLO series models: The category system includes two main dimensions: 1. Morphological dimensions (4 categories): fibers, films, fragments, particles 2. Color dimensions (6 categories): Blue, Black, Transparent, White, Green, and others Combining them forms composite categories, such as fiber_blue and film_transparent.

[0024] In some feasible embodiments, step S2 specifically includes: To improve category balance, this embodiment includes a category statistics module for automatically calculating: the number of instances in each category, the number of images appearing in each category, the aspect ratio distribution of the dataset, and the proportion of small objects.

[0025] If the number of instances of a certain category is lower than the threshold (e.g., <50), the enhancement process will be automatically initiated.

[0026] For scarce categories: 1. Centered on the true target bounding box, according to Generate local patches with three different expansion scales; 2. Apply composite enhancements to the patch, including brightness perturbation, contrast perturbation, saturation adjustment, random noise, blurring, rotation, scaling, and random horizontal flipping; 3. Scale the enhanced patch to the preset input size (e.g., 416×416 or 640×640) for training.

[0027] This method improves the texture and pose diversity of small sample classes.

[0028] To further expand the categories of scarce composite materials, this embodiment proposes a patch synthesis method: 1. Crop the target patch from the labeled image; 2. Randomly scale the patch size to adapt to different microscope magnifications; 3. Randomly select a background image and randomly place the patch on the background; 4. Introduce transparency blending: in This is used to simulate the real light-illuminating properties of transparent microplastics; 5. Automatically generate normalized bounding box coordinates for training.

[0029] This enhancement significantly improves the detection capabilities for transparent, thin film, and small target types.

[0030] In some feasible embodiments, step S3 specifically includes: After loading the YOLOv11 pre-trained weights into the model, transfer learning was performed, and the following optimization strategy was set based on the characteristics of the microscopic scene: Set the input size to 640×640; During the training process, various geometric and color enhancement techniques are introduced, such as Mosaic, MixUp, Copy-Paste, HSV color perturbation, rotation, shearing, and perspective transformation. Based on the characteristics of microplastic targets being small and having complex shapes, the weights of the loss function are adjusted, among which the bounding box regression weights... Distribution focus loss weight This is to enhance the model's ability to fit the position and shape of small targets; The number of training rounds was set to 150, and an early stopping strategy (patience=30) was adopted. The weight with the highest mAP on the validation set was selected as the final model.

[0031] The training objective function can be expressed as: Among them, take , , .

[0032] In some feasible embodiments, it also includes: To accommodate the significant differences in morphology, transparency, and size of microplastics, this invention constructs a scenario-specific computational index system for microplastic composite categories, used for model performance evaluation and training control. The index system includes: Morphology Sensitivity Score (MSS): It is used to measure the model's ability to distinguish between different morphologies such as fibrous, thin-film, fragmented, and granular textures. MSS combines the aspect ratio of the predicted bounding box and the ground truth bounding box, the principal orientation angle, and the texture detail density, and is defined as: in , Aspect ratio, , Main direction angle, , The local texture density is calculated using the Laplacian operator. , , It is an adjustable parameter. This represents the predicted target morphological parameters. This represents the morphological parameters corresponding to the manually annotated standard answers.

[0033] Transparency Detectability Index (TDI): Used to evaluate the model's robustness to detection on transparent microplastics (such as transparent films and transparent fragments). Transparency is estimated by the average of the V channels in the HSV color space, and TDI is defined as: in To determine the confidence level of the model, This is an estimate of transparency.

[0034] Small-object Sensitivity Index (SSI) is a measure of sensitivity to small objects.

[0035] The proportion of small targets in microscopic images is extremely high. This invention uses the following indicators to measure the overall detection capability of small targets: in For the average accuracy of small targets. For small target recall rate.

[0036] Composite Performance Index (CPI).

[0037] For the "shape × color" composite category system proposed in this invention, a comprehensive performance index is constructed: in For the number of composite categories, This represents the average precision for the corresponding category.

[0038] The above-mentioned index system is used to measure the multi-dimensional performance of the model in the microscopic detection scenario. Compared with the traditional AP / mAP index, it can better reflect the characteristics of microscopic images such as morphology, transparency differences, and small target detection capabilities.

[0039] In some feasible embodiments, based on the above-mentioned scenario indicator system, this invention further proposes an indicator-driven adaptive training control mechanism. This mechanism automatically adjusts the enhancement strategy, loss weights, and class sampling ratios according to the dynamic changes of MSS, TDI, SSI, and CPI, thereby improving the stability and generalization ability of the microscopic microplastic detection model. Specifically, this includes: When the MSS is below the threshold, the system automatically increases the proportion of geometric enhancements such as rotation, shearing, and scaling, and increases the amount of compensatory sample generation for fiber and film types.

[0040] When the TDI of the transparent category decreases, the training system automatically enhances the brightness perturbation, contrast perturbation, and synthesis enhancement under transparent background, and increases the sampling weight of the transparent composite category.

[0041] When the SSI index decreases, the system automatically adds local cropping enhancement for small targets of the corresponding category, patch compositing enhancement, and increases the weight of the distribution focus loss. .

[0042] When the AP of a certain composite category is lower than the CPI for a long period of time, the system automatically implements oversampling, boosting, and patch replacement strategies for that category to achieve dynamic balance of training gradients between categories.

[0043] The above training adaptive mechanism can be expressed as: in This is a mapping function for enhancing strength, loss weights, and sampling strategies.

[0044] Through this index-driven mechanism, this invention achieves dynamic optimization to significantly enhance the robustness and detection capability of the model, addressing the challenges of high transparency, class imbalance, and a large proportion of small targets in microscopic plastic detection tasks.

[0045] This invention's method is applicable to: visual analysis of microplastics in rivers, lakes, seawater, and soil; safety monitoring of tap water and drinking water; quantitative analysis of laboratory standard samples; and a visualization platform for teaching and research. It has advantages such as low cost, easy deployment, and strong scalability.

[0046] In summary, this invention possesses the following advantages: 1) High precision and high speed: YOLOv11 has stronger feature representation and inference performance; 2) User-friendly interface: It can be used with zero barriers through the web interface; 3) Exportable results: It automatically generates tables, which facilitates secondary statistical analysis; 4) Easy deployment and scalability: Its modular design can be ported to various microparticle detection tasks.

[0047] Based on the above methods, Figure 2The image to be tested, after being processed by the method of this invention, the detection result is referred to... Figure 3 .

[0048] A microplastic detection system based on YOLOv11 includes: The dataset building module is used to perform step S1; The data augmentation module is used to perform step S2; The model training module is used to execute step S3; The detection module is used to perform step S4.

[0049] The content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0050] A microplastic detection device based on YOLOv11: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements a microplastic detection method based on YOLOv11 as described above.

[0051] The content of the above method embodiments is applicable to the device embodiments. The specific functions implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0052] A storage medium storing processor-executable instructions, which, when executed by a processor, are used to implement a YOLOv11-based microplastic detection method as described above.

[0053] The content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0054] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.

Claims

1. A microplastic detection method based on YOLOv11, characterized in that, Includes the following steps: Acquire microscopic images and construct a dataset; The dataset is subjected to local region cropping enhancement and synthesis enhancement to obtain an optimized dataset; The YOLOv11 model is trained based on the optimized dataset to obtain a trained detection model; The microscopic sample to be tested is input into the trained detection model, and the detection result is output.

2. The microplastic detection method based on YOLOv11 according to claim 1, characterized in that, Also includes: Set up a front-end page for users to upload images; The trained detection model is loaded on the backend.

3. The microplastic detection method based on YOLOv11 according to claim 1, characterized in that, Also includes: The performance of the trained detection model is evaluated based on morphological sensitivity index, transparent target identifiability index, small target sensitivity index, and composite category performance index.

4. The microplastic detection method based on YOLOv11 according to claim 1, characterized in that, Also includes: An adaptive control mechanism is driven by morphological sensitivity indicators, transparent target identifiability indicators, small target sensitivity indicators, and composite category performance indicators.

5. The microplastic detection method based on YOLOv11 according to claim 1, characterized in that, The process of local region clipping and enhancement specifically includes: Generate a local patch centered on the actual target bounding box; The local patch is enhanced by a combination of perturbation and noise addition to obtain an enhanced patch; The enhanced patch is then scaled up.

6. The microplastic detection method based on YOLOv11 according to claim 5, characterized in that, The synthetic enhancement process specifically includes: Cropping the target patch from the labeled image; The size of the target patch is adjusted to obtain the adjusted target patch; The adjusted target patch is placed on the selected background image, and transparency blending is introduced to obtain a new bounding box.

7. The microplastic detection method based on YOLOv11 according to claim 1, characterized in that, The step of driving the adaptive control mechanism based on morphological sensitivity index, transparent target identifiability index, small target sensitivity index, and composite category performance index specifically includes: When the morphology sensitivity index is less than the first index threshold, morphology enhancement adjustment is performed. When the transparency target identifiability index decreases, transparency target enhancement adjustment is performed; When the sensitivity index of the small target decreases, the small target optimization strategy is executed. If the average accuracy of a certain composite category is lower than the performance index of the composite category within a preset time interval, a balanced control is performed on that category.

8. The microplastic detection method based on YOLOv11 according to claim 3 or 4, characterized in that: The formula for calculating the morphological sensitivity index is as follows: in, , Aspect ratio, , Main direction angle, , The local texture density is calculated using the Laplacian operator. , , It is an adjustable parameter. This represents the predicted target shape parameters. The morphological parameters corresponding to manually annotated standard answers; The formula for calculating the identifiability index of transparent targets is as follows: in, To determine the confidence level of the model, This is an estimate of transparency. Indicates the number of samples involved in the calculation. Indicates the first One sample; The formula for calculating the small target sensitivity index is as follows: in, For the average accuracy of small targets. For small target recall rate; Preset weights; The formula for calculating the composite category performance index is as follows: in, For the number of composite categories, This represents the average precision for the corresponding category.

9. A microplastic detection system based on YOLOv11, characterized in that, include: The dataset building module is used to acquire microscopic images and build datasets; The data augmentation module is used to perform local region cropping and enhancement processing and synthetic enhancement processing on the dataset to obtain an optimized dataset; The model training module trains the YOLOv11 model based on the optimized dataset to obtain a trained detection model. The detection module is used to input the microscopic sample to be tested into the trained detection model and output the detection result.