Foreign matter detection method and device, terminal equipment and computer readable storage medium

By preprocessing the sequencing images and detecting foreign matter, the problem of base recognition misjudgment caused by foreign matter in the sequencing chip flow channel was solved, ensuring the accuracy of the sequencing results.

CN120655563APending Publication Date: 2025-09-16GENEMIND BIOSCIENCES CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410311710.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-14
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

During the gene sequencing process, the presence of foreign matter (such as bubbles) in the flow channel of the sequencing chip can lead to misjudgment of base recognition, affecting the confidence level of the sequencing results.

Method used

By acquiring sequencing images, performing preprocessing and then detecting foreign matter, it is determined whether there are foreign matter in the sequencing images, and in the subsequent sequencing process, the area where the foreign matter is located is screened out, using a foreign matter detection device and method.

Benefits of technology

It avoids sequencing errors caused by foreign matter and improves the confidence level of sequencing results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120655563A_ABST
    Figure CN120655563A_ABST
Patent Text Reader

Abstract

The invention discloses a foreign matter detection method and device, terminal equipment and a computer readable storage medium. The foreign matter detection method comprises the following steps: acquiring a sequencing image, wherein the sequencing image is at least one image acquired by performing a round of base extension reaction on a to-be-detected sample in a sequencing chip; the sequencing image is preprocessed; and performing foreign matter detection processing on the preprocessed sequencing image to determine whether foreign matters exist in the sequencing image or not. According to the foreign matter detection method, the foreign matter in the sequencing image is determined by performing foreign matter detection on the sequencing image, and when gene sequencing needs to be performed on the sequencing image subsequently, a sequencing error caused by the foreign matter can be avoided, so that the confidence degree of a sequencing result can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of gene sequencing technology, and in particular to a foreign matter detection method and apparatus, a terminal device, and a computer-readable storage medium. Background Art

[0002] During the sequencing process, foreign matter (such as bubbles generated in the flow channel when sequencing reagents are passed through) is often encountered in the flow channel of the sequencing chip. This may lead to misidentification of the area where the foreign matter is located when identifying bases, thereby affecting the confidence level of the sequencing results. Summary of the Invention

[0003] The present invention provides a foreign body detection method and apparatus, a terminal device, and a computer-readable storage medium to solve at least one of the above-mentioned technical problems.

[0004] A foreign body detection method of the present invention includes: obtaining a sequencing image, wherein the sequencing image is at least one image collected by performing a round of base extension reaction on a sample to be tested in a sequencing chip; preprocessing the sequencing image; and performing foreign body detection processing on the preprocessed sequencing image to determine whether there is a foreign body in the sequencing image.

[0005] A foreign body detection device of the present invention includes: an acquisition unit, used to acquire a sequencing image, wherein the sequencing image is at least one image collected by performing a round of base extension reaction on a sample to be tested in a sequencing chip; a preprocessing unit, used to preprocess the sequencing image; and a detection unit, used to perform foreign body detection processing on the preprocessed sequencing image to determine whether there is a foreign body in the sequencing image.

[0006] A terminal device of the present invention includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the foreign matter detection method of the present invention are implemented.

[0007] A computer-readable storage medium of the present invention stores a computer program thereon, characterized in that when the computer program is executed by a processor, the computer program implements the steps of the foreign matter detection method of the present invention.

[0008] The above-mentioned foreign matter detection method, foreign matter detection device, terminal device and computer-readable storage medium perform foreign matter detection on sequencing images to determine foreign matters in the sequencing images. When the sequencing images need to be sequenced later, sequencing errors caused by foreign matters can be avoided, thereby ensuring the confidence level of the sequencing results.

[0009] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0011] Figure 1 is a schematic diagram of an image with foreign matter obtained by image acquisition of a sequencing chip;

[0012] Figure 2 1 is a flow chart of a foreign body detection method according to an embodiment of the present invention;

[0013] Figure 3 is a schematic diagram of a module of a foreign body detection device according to an embodiment of the present invention;

[0014] Figure 4 Schematic diagram of a scene of acquiring an image of a sequencing chip to obtain a sequencing image according to an embodiment of the present invention;

[0015] Figure 5 1 is another schematic flow chart of a foreign body detection method according to an embodiment of the present invention;

[0016] Figure 6 is another module schematic diagram of the foreign body detection device according to an embodiment of the present invention;

[0017] Figure 7 1 is another flow chart of a foreign body detection method according to an embodiment of the present invention;

[0018] Figure 8 is another module schematic diagram of the foreign body detection device according to an embodiment of the present invention;

[0019] Figure 9 Schematic diagram of image segmentation processing for sequencing images according to an embodiment of the present invention;

[0020] Figure 10 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0021] Figure 11 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0022] Figure 12 is a schematic diagram of a sliding window according to an embodiment of the present invention;

[0023] Figure 13 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0024] Figure 14 is a schematic diagram of a sequencing image before image enhancement processing according to an embodiment of the present invention;

[0025] Figure 15 is a schematic diagram of a sequencing image after image enhancement processing according to an embodiment of the present invention;

[0026] Figure 16 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0027] Figure 17 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0028] Figure 18 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0029] Figure 19 is a schematic diagram of the grayscale value distribution range, the first quantile, and the second quantile according to an embodiment of the present invention;

[0030] Figure 20 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0031] Figure 21 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0032] Figure 22 is a schematic diagram of a sequencing image before low-pass filtering according to an embodiment of the present invention;

[0033] Figure 23 is a schematic diagram of a sequencing image after low-pass filtering according to an embodiment of the present invention;

[0034] Figure 24 is a schematic diagram of a sequencing image before median filtering according to an embodiment of the present invention;

[0035] Figure 25 is a schematic diagram of a sequencing image after median filtering according to an embodiment of the present invention;

[0036] Figure 26 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0037] Figure 27 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0038] Figure 28 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0039] Figure 29 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0040] Figure 30 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0041] Figure 31 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0042] Figure 32 2 is another module schematic diagram of the foreign body detection device according to the embodiment of the present invention;

[0043] Figure 33 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0044] Figure 34 is a schematic diagram of a sequencing image in which abnormal regions are detected according to an embodiment of the present invention;

[0045] Figure 35 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0046] Figure 36 2 is another module schematic diagram of the foreign body detection device according to the embodiment of the present invention;

[0047] Figure 37 is a schematic diagram of a sequencing image with bright spots according to an embodiment of the present invention;

[0048] Figure 38 is a schematic diagram of a sequencing image with a black hole according to an embodiment of the present invention;

[0049] Figure 39 1 is another flow chart of the foreign body detection method according to the embodiment of the present invention;

[0050] Figure 40 2 is another module schematic diagram of the foreign body detection device according to the embodiment of the present invention;

[0051] Figure 41 It is a module diagram of a terminal device according to an embodiment of the present invention.

[0052] Description of main component symbols:

[0053] Foreign matter detection device 10;

[0054] Acquisition unit 11; preprocessing unit 12, first preprocessing subunit 121, second preprocessing subunit 122, third preprocessing subunit 123; detection unit 13, first detection subunit 131, second detection subunit 132; testing unit 14;

[0055] Sequencing chip 20, chip flow channel 21, flow channel area 22;

[0056] Terminal device 100; memory 110, processor 120. DETAILED DESCRIPTION

[0057] In the description of the present invention, some of the disclosed contents have been correspondingly illustrated in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The contents described below with reference to the accompanying drawings are illustrative and are only used to explain the present invention, and are not to be construed as limiting the present invention.

[0058] In the description of the present invention, many different contents or examples are disclosed to realize different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention.

[0059] Furthermore, 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 the technical features being referred to. Thus, features defined as "first" or "second" may explicitly or implicitly include one or more of the described features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.

[0060] In addition, reference numerals and / or reference letters may be repeated in different examples of the present invention. Such repetition is for the purpose of simplicity and clarity and does not in itself indicate a relationship between the various situations and / or settings discussed.

[0061] In the present invention, the term "sequencing" may be referred to as "nucleic acid sequencing" or "gene sequencing." The three terms are interchangeable and may refer to the determination of the type and order of bases or nucleotides (including nucleotide analogs) in a nucleic acid molecule. Sequencing may include the process of binding nucleotides to a template and collecting the corresponding signals emitted by the nucleotides (including analogs). The so-called sequencing may include sequencing by synthesis (SBS, Sequencing by Synthesis) and / or sequencing by ligation (SBL, Sequencing by Ligation), and may include DNA sequencing and / or RNA sequencing.

[0062] In the present invention, the term "nucleic acid molecule" may refer to a polymeric form of nucleotides of any length and may include ribonucleotides or their analogs, deoxyribonucleotides or their analogs, and mixtures of the above nucleotides or their analogs. Nucleic acid molecules may refer to single-stranded polynucleotides or double-stranded polynucleotides. The nucleotides in a nucleic acid molecule may include naturally occurring nucleotides and their functionally alternative analogs. Examples of analogs are capable of hybridizing with nucleic acids in a sequence-specific manner or of serving as templates for the replication of a specific nucleotide sequence. Naturally occurring nucleotides may typically have a backbone comprising a phosphodiester bond. Analog structures may have alternative backbone connections comprising any type known in the art. Naturally occurring nucleotides may typically have deoxyribose (e.g., found in DNA) or ribose (e.g., found in RNA). Analog structures may have alternative sugar moieties comprising any type known in the art. Nucleotides may include natural bases or non-natural bases. The bases in natural DNA may include one or more of adenine, thymine, cytosine, and / or guanine, and the bases in natural RNA may include one or more of adenine, uracil, cytosine, and / or guanine. Nucleotides may also use any non-natural bases or base analogs, such as locked nucleic acids (LNAs) and bridged nucleic acids (BNAs).

[0063] In related technologies, during the sequencing process, it is often encountered that there are foreign objects in the flow channel of the sequencing chip (such as bubbles generated in the flow channel when the sequencing reagent is passed through the liquid), which may cause the area where the foreign objects are located to be misidentified when identifying the base, thereby affecting the confidence level of the sequencing results.

[0064] Specifically, please combine Figure 1 , Figure 1 It shows part of an image collected from a sequencing chip during the gene sequencing process. Figure 1 In the image, foreign matter is present in regions S1, S2, and S3. These foreign matter may be fine particles previously trapped in the chip flow path, or bubbles formed by residual gas from the corresponding reagents introduced into the chip flow path during the sequencing process. Images of these foreign matter remain in the image, leading to misidentification of bases during subsequent image-based base sequence recognition. These images also obscure the optical information of the bases at their locations, significantly impacting the image-based base sequence recognition process and the confidence level of the final sequencing results.

[0065] The present invention is to detect foreign matter in the collected images to clarify whether there are foreign matter in the images and the specific location of the foreign matter. When identifying the base sequence based on the image, the area where the foreign matter is located can be screened out to reduce the impact of foreign matter on the identification results.

[0066] Please refer to Figure 2 , a foreign body detection method of the present invention may include:

[0067] 01: Acquire a sequencing image, which is at least one image acquired by performing a base extension reaction on the sample to be tested in the sequencing chip 20;

[0068] 02: Preprocess the sequencing images;

[0069] 03: Perform foreign body detection on the pre-processed sequencing image to determine whether there are foreign bodies in the sequencing image.

[0070] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 3 The foreign body detection device 10 may include an acquisition unit 11, a preprocessing unit 12, and a detection unit 13. The acquisition unit 11 may be used to acquire a sequencing image. The preprocessing unit 12 may be used to preprocess the sequencing image. The detection unit 13 may be used to perform foreign body detection on the preprocessed sequencing image to determine whether a foreign body is present in the sequencing image.

[0071] The above-mentioned foreign body detection method and foreign body detection device 10 perform foreign body detection on the sequencing image to determine the foreign body in the sequencing image. When the sequencing image needs to be sequenced later, sequencing errors caused by foreign bodies can be avoided, and the confidence level of the sequencing results can be guaranteed.

[0072] In some cases, the sequencing performed on the sample to be tested can be sequencing by synthesis. Specifically, in the sequencing by synthesis process, by adding a reagent containing dNTP (deoxy-ribonucleoside triphosphate) and a polymerase, the dNTP can be used as a starting point to complement the nucleic acid template chain of the sample to be tested to extend on the sequencing primer. Among them, each complementary pairing of one dNTP is considered to be a round of base extension reaction. On this basis, through multiple rounds of base extension reactions, a new chain complementary to the nucleic acid template chain of the sample to be tested can be finally synthesized.

[0073] Please combine Figure 4 ,exist Figure 4 In the embodiment, the sequencing chip 20 may have multiple chip flow channels 21, which may extend along directions A1 and A2 and form two ends. A fluid may be introduced into one end of the chip flow channel 21. The fluid may flow through the entire chip flow channel 21 at one end and flow out from the other end of the chip flow channel 21.

[0074] The sample to be tested can be set in the chip flow channel 21. When the fluid containing the corresponding reagent flows through the chip flow channel 21, the sample to be tested can undergo a round of base extension reaction.

[0075] The dNTPs can be labeled with optical signals, and different types of dNTPs can be labeled with different optical signals. During each round of base extension reaction, the optical signal displayed in the captured image can be used to determine the base type of the dNTP, and furthermore, the base type of the corresponding base within the nucleic acid template strand of the sample to be tested in the current round of base extension reaction can be determined. The optical signal can be a fluorescent signal.

[0076] In some cases, an image with a corresponding optical signal can be captured by a corresponding image capture device. Specifically, when the base extended in the current round of base extension reaction is base A, an image capture device corresponding to base A can be used to capture an optical signal image corresponding to base A. The sequencing image can be an image captured by one of the image capture devices, or one of multiple images captured by one of the image capture devices.

[0077] exist Figure 4 In the embodiment, the chip flow channel 21 may have a flow channel region 22. After a round of base extension reaction, the entire flow channel region 22 may be imaged to obtain a first image. Figure 4 In the example, the first image can be represented as P1. By obtaining the first image, the light signal emitted in the entire flow channel region 22 after the sample to be tested undergoes a round of base extension reaction can be determined.

[0078] In some cases, it is also possible to acquire an image of a portion of the flow channel region 22, and then determine the light signal emitted in the flow channel region 22 based on the acquired image. Specifically, a region may be selected in the flow channel region 22 using multiple grids with a certain number of rows and columns, and then the image content in the region selected by each grid is used as a second image. Figure 4 In [1], the grid can be represented as G1 and the second image can be represented as P2. By obtaining multiple second images, the subsequent image processing flow can be facilitated under the premise of having a sufficient sample size.

[0079] The size of each grid can be the same or different. There can be a gap between two adjacent grids, or they can be close to each other.

[0080] In addition, both the first image and the second image can serve as sequencing images.

[0081] On the basis of the above, in the process of performing multiple rounds of base extension reaction to synthesize new chains, since the corresponding reagents need to be repeatedly introduced into the chip flow channel 21, the tiny particles and bubbles mixed in the reagents will enter the chip flow channel 21 as foreign matter (such as Figure 1 As shown), when the image of the flow channel area 22 is acquired, the image information of these foreign objects will be acquired.

[0082] In the present invention, when a sequencing image of the chip flow channel 21 is obtained, the sequencing image can be preprocessed first, and then the preprocessed sequencing image can be subjected to foreign matter detection processing to determine whether there are foreign matters in the sequencing image, thereby facilitating subsequent sequencing of the sample to be tested.

[0083] In some cases, when it is determined that there are foreign objects in the sequencing image, the area with the foreign objects in the sequencing image can be filtered out, and the area without foreign objects in the sequencing image can be sequenced to avoid the foreign objects affecting the confidence level of the sequencing results.

[0084] In addition, based on the present invention, after foreign matter is detected, improvements can be made from the perspectives of biochemistry and materials. For example, the airtightness of the sequencing chip 20 can be improved, and the foreign matter can be removed by passing liquid.

[0085] In the present invention, when a round of base extension reaction is performed on the sample to be tested in the sequencing chip 20 to collect multiple images, the sequencing image may be an image with the strongest optical signal among the multiple images.

[0086] In this way, the recognition of the image can be improved.

[0087] Specifically, please combine Figure 1 During a round of base extension reaction, by acquiring multiple images, it is possible to avoid the situation where the brightness is dim and image recognition is inconvenient when only a single image is collected. Using the image with the strongest optical signal as the sequencing image can make the content displayed in the image clearer and more visible, thereby improving the image recognition and reducing misidentification.

[0088] In the present invention, multiple images can be captured by the imaging system in the base C channel.

[0089] In this way, an image with sufficient brightness can be easily obtained as a sequencing image.

[0090] Generally, when a sequencing image is obtained by acquiring images through multiple image acquisition devices (such as cameras), each image acquisition device can correspond to one of the base channels of the sample to be tested. After completing a round of base extension reaction, the extended base can emit a light signal in the corresponding base channel, and the image acquisition device can collect the light signal in the corresponding base channel. Since the image captured under the base C channel has the maximum brightness, it is easier to identify the content displayed by the image by using it as an image. Moreover, in the subsequent processing flow, brightness enhancement processing is not required because the image has sufficient brightness, which is conducive to simplifying the processing flow and improving processing efficiency.

[0091] Please refer to Figure 5 In the present invention, step 02 (preprocessing the sequencing image) may include:

[0092] 021: Perform image segmentation processing on sequencing images;

[0093] 023: Perform image filtering on sequencing images.

[0094] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 6 The pre-processing unit 12 may include a first pre-processing sub-unit 121 and a third pre-processing sub-unit 123. The first pre-processing sub-unit 121 may be used to perform image segmentation processing on the sequencing image. The third pre-processing sub-unit 123 may be used to perform image filtering processing on the sequencing image.

[0095] This makes subsequent processing of sequencing images easier.

[0096] Among them, by performing image segmentation processing on the sequencing image, the amount of data that needs to be processed at a single time can be reduced, and excessive system performance can be avoided when performing foreign body detection; by performing image filtering processing on the sequencing image, the interference in the image can be reduced, and the occurrence of misjudgment and missed judgment can be reduced in subsequent foreign body detection.

[0097] In addition, in some cases, the image segmentation processing step may be performed first and then the image filtering processing step, or the image filtering processing step may be performed first and then the image segmentation processing step.

[0098] Please refer to Figure 7 In the present invention, step 021 (performing image segmentation processing on the sequencing image) may include:

[0099] 0211: cutting the sequencing image into multiple first sub-images according to a preset cutting path;

[0100] Step 03 (performing foreign body detection processing on the pre-processed sequencing image) may include:

[0101] 031: Perform foreign body detection processing on multiple first sub-images.

[0102] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 8 The detection unit 13 may include a first detection subunit 131. The first pre-processing subunit 121 may be configured to cut the sequencing image into a plurality of first sub-graphs according to a preset cutting path. The first detection subunit 131 may be configured to perform foreign body detection processing on the plurality of first sub-graphs.

[0103] In this way, the efficiency of the cutting process can be improved.

[0104] Please combine Figure 9 Specifically, the sequencing image can be cut according to multiple grids arranged along a preset cutting path. The A3 and A4 directions can represent the arrangement directions of the multiple grids. The grid used to cut out the first sub-image can be represented as G2. The edges of the grid G2 can form the preset cutting path.

[0105] The direction of the preset cutting path may include the length direction and the height direction of the sequencing image. The plurality of first sub-graphs can be arranged in rows along the length direction and in columns along the height direction. Figure 9 In the example, multiple grids G2 can be arranged into multiple rows along the A3 direction and multiple columns along the A4 direction. After the sequencing image is cut into multiple first sub-images, foreign matter detection can be performed on each of the first sub-images in sequence. Since cutting by rows and columns allows for quick and easy determination of cutting positions, the efficiency of the cutting process can be improved.

[0106] Additionally, a sequencing image can have a width and a height, Figure 9 In the example, the width direction of the sequencing image can be parallel to the A4 direction, and the height direction of the sequencing image can be parallel to the A3 direction.

[0107] The size of the grid used to slice the sequencing image can be set. In one embodiment, the set grid size can be 1323*768 (width*height). The number of rows and columns formed by the arrangement of multiple grids can be determined based on the sequencing image. Specifically, the number of columns is obtained by dividing the width of the sequencing image by the width of the grid and rounding, and the number of rows is obtained by dividing the height of the sequencing image by the height of the grid and rounding.

[0108] Please refer to Figure 10 In the present invention, step 031 (performing foreign body detection processing on multiple first sub-images) may include:

[0109] 0311: Process multiple first subgraphs in parallel through multiple threads.

[0110] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 8 The first detection subunit 131 may be configured to perform parallel processing on multiple first sub-images through multiple threads.

[0111] In this way, the efficiency of the foreign matter detection process can be improved.

[0112] In some cases, the parallel processing of the multiple first subgraphs may be processing the multiple first subgraphs separately according to multiple threads, or processing the multiple first subgraphs separately according to multiple threads.

[0113] Compared with serial processing of the entire sequencing image, parallel processing can process multiple sub-images, which can reduce the overall processing time.

[0114] In addition, multiple first subgraphs may be processed in parallel using multiple threads. In some cases, the processing time using multiple threads can be reduced to 1 / 6 of the processing time using a single thread, or to 1 / 5 of the processing time using a single thread.

[0115] Please refer to Figure 11 In the present invention, after step 0211 (cutting the sequencing image into a plurality of first sub-graphs according to a preset cutting path), the following steps may be included:

[0116] 0212: Obtain a second sub-image according to a corresponding sliding window for an adjacent area between two adjacent first sub-images;

[0117] Step 031 (performing foreign body detection processing on multiple first sub-images) may include:

[0118] 032: Perform foreign object detection processing on multiple second sub-images.

[0119] In this way, it is possible to avoid missing the detection of foreign matter located at the cutting position between two adjacent first sub-images.

[0120] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 8 The first pre-processing sub-unit 121 can be used to obtain a second sub-image according to a corresponding sliding window for an adjacent area between two adjacent first sub-images. The first detection sub-unit 131 can be used to perform foreign body detection processing on multiple second sub-images.

[0121] Please combine Figure 12Specifically, the grid used to cut the sequencing image to obtain the first sub-graph can be expressed as G2, and the sliding window used to obtain the second sub-graph can be expressed as G3. Figure 12 In the example, two grids G2 are arranged adjacent to each other, and the sliding window G3 partially overlaps with one of the grids G2 (the overlapping area is Figure 12 The sliding window G3 partially overlaps with another grid G2 (the overlapping area is in Figure 12 Region Z1 and region Z2 may constitute a contiguous region between two adjacent first subgraphs.

[0122] In the present invention, whether a foreign object is a foreign object can be determined based on its outline, thereby achieving effective foreign object recognition. However, in actual applications, a foreign object may be located between two adjacent grids G2. After obtaining multiple first sub-images, a foreign object completely within one of the first sub-images can be identified. However, a foreign object between two adjacent first sub-images will have its complete outline destroyed due to the cutting process, making it impossible to identify the foreign object based on a single first sub-image.

[0123] On the basis of the above, by setting a sliding window to intercept the image between two adjacent first sub-images, the second sub-image can completely display the image information between the two adjacent first sub-images. If the outline of the foreign object is cut and destroyed, the second sub-image obtained through the sliding window can display the complete outline of the foreign object, thereby avoiding the situation where the foreign object cannot be identified due to the incomplete outline of the foreign object in the first sub-image.

[0124] In addition, in some cases, all the first sub-graphs and the second sub-graphs can be acquired first, and then the first sub-graphs and the second sub-graphs can be detected. Alternatively, the first sub-graphs can be acquired and detected in sequence first, and the second sub-graphs can be acquired and detected during this process, thereby achieving the effect of parallel processing of sequencing images.

[0125] In the present invention, the step length between a first sub-image and a corresponding second sub-image can be determined by the length or width of the first sub-image.

[0126] In this way, the missed detection rate of foreign objects can be reduced.

[0127] Specifically, in Figure 12 In the example, the length of grid G2 can be parallel to the A4 direction, and the width of grid G2 can be parallel to the A3 direction. The length of sliding window G3 can be parallel to the length of grid G2. One of the long sides of sliding window G3 can be aligned with one of the long sides of grid G2, and the other long side of sliding window G3 can be aligned with the other long side of grid G2. Sliding window G3 can be moved relative to grid G2 along the A4 direction, thereby adjusting the viewing window of sliding window G3 for capturing the second sub-image.

[0128] exist Figure 12 In the example, the distance of the sliding window G3 relative to the grid G2 along the A4 direction can be used as the step length between the first sub-image and the corresponding second sub-image. Specifically, the sliding window G3 can be formed with wide edges at both ends along the A4 direction, and the grid G2 can also be formed with wide edges at both ends along the A4 direction. The step length can be the distance between the wide edges of the sliding window G3 and the grid G2 at the same end. Figure 12 In the example, the step size can be expressed as S.

[0129] Based on the above, the step length between the first sub-image and the corresponding second sub-image is determined according to the length of the first sub-image, and the size of the intercepted second sub-image can be flexibly adjusted to ensure that the foreign object has a complete outline in the second sub-image.

[0130] In addition, the step size between the first sub-image and the corresponding second sub-image can also be determined by the difference between the window width and the maximum width of the foreign object, where the window width is the width of the first sub-image or the width of the second sub-image, and the maximum width of the foreign object is the maximum value of the distance between any two points on the foreign object in the sequencing image.

[0131] In some cases, the maximum width of a foreign object can be the diameter of an estimated circle. The estimated circle can be the circumscribed circle of the foreign object's outline in the sequencing image. In other words, both points in the foreign object's outline in the sequencing image corresponding to the maximum width can lie on the estimated circle. If the foreign object is a bubble, the maximum width of the foreign object can be the diameter of the circular outline of the bubble.

[0132] In some cases, the step size may be the difference between the length of the grid G2 and the diameter of the estimated circle. Generally, the step size may be half the length of the grid G2.

[0133] In addition, in other cases, the step length between the first sub-image and the second sub-image is also determined by the width of the first sub-image. The specific implementation principle can refer to the aforementioned case of determining the step length between the first sub-image and the second sub-image based on the length of the first sub-image, which will not be elaborated here.

[0134] Please refer to Figure 13 In the present invention, step 02 (preprocessing the sequencing image) may include:

[0135] 022: Perform image enhancement processing on sequencing images.

[0136] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 6 The pre-processing unit 12 may include a third pre-processing sub-unit 123. The third pre-processing sub-unit 123 may be used to perform image enhancement processing on the sequencing image.

[0137] In this way, the recognition level of foreign objects in the image can be improved.

[0138] Specifically, please combine Figure 14 and Figure 15 ,in, Figure 14 Shows the sequencing image before image enhancement processing. Figure 15 The sequencing images after image enhancement are shown. Figure 14 In the image, the grayscale value of the pixels is generally low, making the overall sequencing image dark. Figure 15 In the image, the grayscale value of the pixel is relatively high, making the foreign objects in the sequencing image clearly visible. However, since the foreign objects in the sequencing image are blocked by light and form darker outlines, the outlines of the foreign objects may not be identified.

[0139] It's understandable that foreign matter can be detected by analyzing the grayscale distribution of different pixels in a sequencing image. However, in some cases, factors can cause the overall grayscale value of the sequencing image to be low, hindering the identification of foreign matter. Image enhancement processing can improve the overall grayscale distribution of the sequencing image, enabling clear identification of foreign matter.

[0140] In addition, Figure 13 In the process, image enhancement processing can be performed after the image cutting processing is completed, thereby performing image enhancement processing on the multiple first sub-images obtained by cutting, and / or performing image enhancement processing on the second sub-image to ensure that the pixels in the image can be easily identified and the interference in the image can be made more obvious. After the image enhancement processing is completed, image filtering processing is performed to improve the noise reduction effect of the image. In some cases, after the first sub-image has been enhanced, the second sub-image may not be enhanced or may be further enhanced. In other cases, the second sub-image may also be enhanced without enhancing the first sub-image.

[0141] Of course, it is understandable that for those skilled in the art, the execution order between step 021, step 022 and step 023 can be adjusted according to actual needs (for example, step 022 can be executed first to perform image enhancement, then step 023 can be executed to eliminate noise interference, and finally step 021 can be executed to cut the image for foreign body detection), so that the technical concept of the present invention is not limited to the figure.

[0142] Please refer to Figure 16 In the present invention, step 022 (performing image enhancement processing on the sequencing image) may include:

[0143] 0221: When performing image enhancement processing on multiple first sub-images, image enhancement processing is only performed on the first sub-image whose grayscale value mean is less than the set grayscale value. The multiple first sub-images are obtained by cutting the sequencing image according to the corresponding row and column lengths. The multiple first sub-images can be arranged in rows and columns to form a sequencing image.

[0144] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 6 The third pre-processing sub-unit 123 can be used to perform image enhancement processing only on the first sub-images whose average grayscale value is less than the set grayscale value when performing image enhancement processing on multiple first sub-images.

[0145] In this way, the processing time of the image enhancement process can be reduced.

[0146] Specifically, when the sequencing image is divided into multiple first sub-images, the mean grayscale value of all pixels in each first sub-image can be measured. If the mean grayscale value of a first sub-image is higher than a set grayscale value, it can be determined that the grayscale value distribution of the first sub-image is high, the overall brightness is sufficiently high, and the outline of the foreign object in the image can be clearly identified, thus eliminating the need for image enhancement processing for this first sub-image. Since the amount of data to be processed is reduced, the processing time of the image enhancement process can also be reduced accordingly.

[0147] In some cases, the grayscale value may be set in the range of [120, 140].

[0148] Please refer to Figure 17 In the present invention, step 022 (performing image enhancement processing on the sequencing image) may include:

[0149] 0222: Perform grayscale value anomaly removal on the pixels in the sequencing image based on the grayscale value distribution range of the sequencing image.

[0150] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 6 The third pre-processing sub-unit 123 can be used to perform grayscale value anomaly removal processing on the pixels in the sequencing image according to the grayscale value distribution range of the sequencing image.

[0151] In this way, abnormal pixels in the image can be prevented from interfering with foreign object detection.

[0152] Specifically, if the grayscale value of a pixel in the image deviates significantly from the grayscale values ​​of other pixels, it will be determined as an abnormal pixel.

[0153] It is understandable that when there are abnormal pixels in the image, if the contour of a foreign object needs to be detected, the abnormal pixels may not be considered as pixels on the edge of the foreign object's contour due to the large deviation in the grayscale value, thus the foreign object may be missed.

[0154] On the basis of the above, by determining the grayscale value distribution range of the sequencing image, it is easy to determine the abnormal pixels in the image and perform grayscale value de-anomaly processing on the abnormal pixels. The deviation of the grayscale values ​​of the processed abnormal pixels is small, which can reduce the interference with foreign body detection.

[0155] Please refer to Figure 18 In the present invention, step 0222 (performing grayscale value anomaly removal processing on pixels in the sequencing image according to the grayscale value distribution range of the sequencing image) may include:

[0156] 02221: If the grayscale value of a pixel in the sequencing image is less than the first quantile of the grayscale value distribution range, adjust the grayscale value of the pixel to the grayscale value corresponding to the first quantile;

[0157] 02222: If the grayscale value of a pixel in the sequencing image is greater than the second quantile of the grayscale value distribution range, adjust the grayscale value of the pixel to the grayscale value corresponding to the second quantile;

[0158] Among them, the first quantile is smaller than the second quantile.

[0159] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 6 The third preprocessing subunit 123 can be used to: if the grayscale value of a pixel point in the sequencing image is less than the first quantile of the grayscale value distribution range, adjust the grayscale value of the pixel point to the grayscale value corresponding to the first quantile; if the grayscale value of a pixel point in the sequencing image is greater than the second quantile of the grayscale value distribution range, adjust the grayscale value of the pixel point to the grayscale value corresponding to the second quantile.

[0160] In this way, the interference caused by abnormal pixels can be easily and quickly reduced.

[0161] Specifically, please combine Figure 19 In some cases, the grayscale value distribution range in the sequencing image is [v1, v2]. When grayscale value anomaly removal is required, a first quantile and a second quantile can be determined within the grayscale value distribution range. The first quantile can correspond to a percentage (a%), and accordingly, the grayscale value of the first quantile within the grayscale value distribution range can be v1 + (v2 - v1) × a%. The second quantile can correspond to a percentage (b%), and accordingly, the grayscale value of the second quantile within the grayscale value distribution range can be v1 + (v2 - v1) × b%.

[0162] On the basis of the above, for pixels whose grayscale values ​​are within [v1, v1+(v2-v1)×a%), they can be determined as abnormal pixels with low grayscale values. When performing grayscale value de-anomaly processing, the grayscale value of the pixel will be adjusted to the grayscale value corresponding to the first quantile, that is, v1+(v2-v1)×a%. For pixels whose grayscale values ​​are within (v1+(v2-v1)×b%, v2], they can be determined as abnormal pixels with high grayscale values. When performing grayscale value de-anomaly processing, the grayscale value of the pixel will be adjusted to the grayscale value corresponding to the second quantile, that is, v1+(v2-v1)×b%.

[0163] In addition, the first quantile and the second quantile may be different quantiles of the grayscale value distribution range. In some cases, the value range of the first quantile may be [1%, 10%], and the value range of the second quantile may be [90%, 99%].

[0164] Please refer to Figure 20 In the present invention, step 022 (performing image enhancement processing on the sequencing image) may include:

[0165] 0223: Perform normalization processing on the sequencing image so that the gray value distribution range of the sequencing image is transformed from the original gray value distribution range to the set gray value distribution range.

[0166] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 6 The third pre-processing sub-unit 123 can be used to perform normalization processing on the sequencing image so that the gray value distribution range of the sequencing image is transformed from the original gray value distribution range to the set gray value distribution range.

[0167] In this way, the accuracy of foreign body detection can be improved.

[0168] Specifically, the minimum value of the original grayscale value distribution range can be smaller than the minimum value of the set grayscale value distribution range, so that pixels with relatively low grayscale values ​​can have greater brightness after normalization; the maximum value of the original grayscale value distribution range can be greater than the maximum value of the set grayscale value distribution range, so that pixels with relatively high grayscale values ​​can have smaller brightness after normalization.

[0169] On the basis of the above, normalization processing can make the grayscale value distribution of the sequencing image relatively concentrated, which can improve the identifiability of foreign matter during foreign matter detection, and thus improve the accuracy of foreign matter detection.

[0170] In addition, in some cases, grayscale value de-anomaly processing can be performed first, and then normalization processing can be performed, so as to avoid the situation where abnormal pixels still exist when only normalization processing is performed.

[0171] In the present invention, the normalization process can be achieved by the following calculation formula:

[0172]

[0173] in, It can represent the gray value of the pixel point of the sequencing image within the set gray value distribution range, and x can represent the gray value of the pixel point of the sequencing image within the original gray value distribution range. max The maximum grayscale value that can represent the original grayscale value distribution range, x min The minimum gray value that can represent the original gray value distribution range, x max ' can represent the maximum gray value of the gray value distribution range, x min ' can represent the minimum grayscale value of the grayscale value distribution range.

[0174] In addition, the maximum grayscale value and the minimum grayscale value of the grayscale value distribution range can be adjusted according to specific circumstances, or calibrated according to actual tests.

[0175] Please refer to Figure 21 In the present invention, step 023 (performing image filtering processing on the sequencing image) may include:

[0176] 0231: Perform low-pass filtering on sequencing images;

[0177] 0232: Perform median filtering on sequencing images.

[0178] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 6 The second pre-processing sub-unit 122 can be used to: perform low-pass filtering on the sequencing image; and perform median filtering on the sequencing image.

[0179] This is conducive to achieving a smoothing effect on the sequencing image.

[0180] Please combine Figure 22 and Figure 23 , Figure 22 Shows the sequencing image before low-pass filtering. Figure 23 The image below shows a sequencing image after low-pass filtering. Low-pass filtering can remove high-frequency signals from the image, reducing their interference and smoothing the image.

[0181] Please combine Figure 24 and Figure 25 , Figure 24 Shows the sequencing image before median filtering. Figure 25 The image shows a sequencing image after median filtering. By performing median filtering on the sequencing image, noise signals in the sequencing image can be filtered out, reducing the interference of noise signals on the sequencing image, and thus achieving a smoothing effect on the sequencing image.

[0182] Please refer to Figure 26 In the present invention, step 0231 (performing low-pass filtering on the sequencing image) may include:

[0183] 02311: Perform frequency domain transformation on the sequencing image to obtain the spectrum of the sequencing image;

[0184] 02313: Perform time domain transformation on the low-frequency part of the spectrum to filter out high-frequency interference in the sequencing image.

[0185] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 6 The second pre-processing sub-unit 122 can be used to: perform frequency domain transformation processing on the sequencing image to obtain a spectrum diagram of the sequencing image; and perform time domain transformation processing on the low-frequency part of the spectrum diagram to filter out high-frequency interference in the sequencing image.

[0186] In this way, the effect of filtering out high-frequency signals in the sequencing image can be achieved.

[0187] It can be understood that by performing frequency domain transformation processing to convert from the time domain to the frequency domain, the frequency of the high-frequency signal in the sequencing image can be determined, and then only the low-frequency part of the sequencing image is subjected to time domain transformation processing to convert from the frequency domain back to the time domain. Since the high-frequency signal in the sequencing image will not be converted back to the time domain, the sequencing image obtained after the time domain transformation processing will not carry the original high-frequency signal, thereby achieving the effect of filtering out high-frequency interference.

[0188] In some cases, the low-frequency portion of the spectrum graph may be determined based on a region in the spectrum graph where the frequency is less than a set frequency.

[0189] In addition, in some cases, the frequency domain transform processing may be a Fourier transform, and the time domain transform processing may be an inverse Fourier transform.

[0190] In the present invention, low-pass filtering can be achieved by the following calculation formula:

[0191]

[0192]

[0193] Among them, f(x1,y1) can represent the signal value of the pixel located at the x1th row and y1th column in the pixel array of the sequencing image, M can represent the number of rows of the pixel array of the sequencing image, N can represent the number of columns of the pixel array of the sequencing image, F(u1,v1) can represent the frequency domain transformation result obtained by Fourier transforming f(x1,y1), F(u2,v2) can represent the low-frequency part of F(u1,v1), and f(x2,y2) can represent the time domain transformation result of F(u2,v2).

[0194] Please refer to Figure 27 In the present invention, after step 02311 (performing frequency domain transformation processing on the sequencing image to obtain a spectrum diagram of the sequencing image), the following steps may be included:

[0195] 02312: When a spectrum graph is obtained, a clip is made at the center of the spectrum graph according to the set window, and the clipped part is used as the low-frequency part of the spectrum graph.

[0196] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 6 The second pre-processing sub-unit 122 can be used to intercept the center of the spectrum graph according to the set window when the spectrum graph is obtained, and use the intercepted part as the low-frequency part of the spectrum graph.

[0197] In this way, the low-frequency part in the sequencing image can be easily and quickly determined.

[0198] It can be understood that, generally, the brightness change degree of the center of the spectrum graph is relatively gentle, and the low-frequency part of the spectrum graph can be obtained by setting a window to intercept the center of the spectrum graph. In this way, there is no need to determine the low-frequency part of the spectrum graph by detecting the brightness change degree of the spectrum graph, and the low-frequency part in the sequencing image can be quickly determined.

[0199] In addition, the window size of the set window can be determined based on the size of the image that has undergone frequency domain transformation. Specifically, if the image that has undergone frequency domain transformation is a sequencing image, the window size will be determined based on the size of the sequencing image. If the image that has undergone frequency domain transformation is the first or second sub-image, the window size will be determined based on the size of the first or second sub-image.

[0200] Furthermore, in some cases, the size of the setting window can be adjusted based on the size ratio of the first or second subgraph relative to the sequencing image. Specifically, the size (width * height) of the setting window corresponding to the sequencing image can be 360 ​​* 360, and the size (width * height) of the setting window corresponding to the first or second subgraph can be (360 * c) * (360 * c), where c is the scale ratio of the first or second subgraph relative to the sequencing image.

[0201] Please refer to Figure 28 In the present invention, step 0232 (performing median filtering on the sequencing image) may include:

[0202] 02322: Perform median filtering on the sequencing image according to the set filter kernel to filter out noise in the sequencing image.

[0203] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 6 The second pre-processing sub-unit 122 can be used to perform median filtering on the sequencing image according to the set filter kernel to filter out noise in the sequencing image.

[0204] In this way, the effect of filtering out noise in the image can be achieved.

[0205] Specifically, in some cases, the sequencing image can be viewed as a matrix composed of multiple pixel points arranged in rows and columns. When the filter kernel scans the sequencing image in sequence, the filter kernel can be used as a weight matrix to perform weighted processing on the multiple pixel points covered by the filter kernel at the corresponding moment. The result obtained after processing will be assigned to a pixel point at the corresponding position in the filter kernel. After the filter kernel scans the sequencing image, a sequencing image after median filtering can be obtained.

[0206] On the basis of the above, since the pixel points that are noises within the filter kernel will no longer affect the sequencing image after median filtering, or the impact brought by them is greatly weakened by other pixel points within the filter kernel, the filter kernel can be used to filter the noisy parts of the sequencing image, thereby reducing the overall noise of the sequencing image.

[0207] Please refer to Figure 29 In the present invention, step 02322 (performing a median filter on the sequencing image according to a set filter kernel to filter out noise in the sequencing image) may include:

[0208] 023221: Replace the pixel value of the pixel at the center of the filter kernel with the median value of the pixel values ​​of all pixels in the filter kernel.

[0209] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 6 The second pre-processing sub-unit 122 may be configured to replace the pixel value of the pixel located at the center of the filter kernel with the median value of the pixel values ​​of all the pixel points in the filter kernel.

[0210] In this way, the effect of filtering out noise can be improved.

[0211] Specifically, each pixel's brightness is reflected by its own pixel value. For noisy pixels, their brightness is higher or lower than that of surrounding pixels. Within the filter kernel, by determining the pixel value of each pixel, the median value can be selected in order of pixel value magnitude as the pixel value of the pixel at the center of the filter kernel. This can filter out pixels with high or low values, thereby improving the noise filtering effect.

[0212] On the basis of the above, since the influence of noisy pixels can be completely eliminated, the influence of noise sensitivity on subsequent detection results during foreign object detection can be avoided, which is conducive to improving the accuracy of foreign object detection.

[0213] In addition, the pixel value may be a grayscale value of the pixel.

[0214] Please refer to Figure 30 In the present invention, before step 02322 (performing a median filter on the sequencing image according to a set filter kernel to filter out noise in the sequencing image), the following steps may be included:

[0215] 02321: Determine the size of the filter kernel according to the size of the sequencing image.

[0216] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 6 The second pre-processing sub-unit 122 can be used to determine the size of the filter kernel according to the size of the sequencing image.

[0217] In this way, higher processing efficiency can be guaranteed.

[0218] It is understandable that in practical applications, the size of the sequencing image may fluctuate, so that the sequencing image does not necessarily have a fixed size. Determining the size of the filter kernel according to the size of the sequencing image can reduce the situation where the noise remains due to the filter kernel size being too large, and can also reduce the increase in the processing time of the filtering process due to the filter kernel size being too small.

[0219] In addition, in some cases, the sequencing image may have a standard size. When the size of the sequencing image actually obtained has a scaling ratio relative to the standard size of the sequencing image, the size of the filter kernel used for the median filter process may be adjusted according to the scaling ratio.

[0220] Specifically, the standard size (width * height) of a sequencing image can be 1323 * 768, and the corresponding filter kernel size (width * height) can be 9 * 9. In one case, when the scaling ratio of the actual sequencing image size relative to the standard storage of the sequencing image is less than 0.8 (in other words, the actual sequencing image size is less than 1058 * 614), the filter kernel size (width * height) can be adjusted to 7 * 7; otherwise, a filter kernel size of 9 * 9 can still be used.

[0221] Please refer to Figure 31 In the present invention, step 03 (performing foreign body detection processing on the pre-processed sequencing image) may include:

[0222] 033: Perform image detection on the pre-processed sequencing image to detect whether there is an abnormal area in the sequencing image, and the foreign matter is located in the abnormal area.

[0223] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 32 The detection unit 13 can be used to perform image detection on the preprocessed sequencing image to detect whether there is an abnormal area in the sequencing image, and the foreign matter is located in the abnormal area.

[0224] In this way, the location of foreign matter in the sequencing image can be easily confirmed.

[0225] Specifically, since the outline of the foreign matter in the sequencing image is different from that of the normal part in the sequencing image, by determining the existence of the abnormal area in the sequencing image, it can be known that there is a high possibility of the existence of the foreign matter, while there will be no foreign matter in other normal parts of the sequencing image, which makes it easy to confirm the location of the foreign matter in the sequencing image.

[0226] Among them, the light signal emitted by the sample to be tested can be detected in the normal part of the sequencing image, while in the abnormal area, the light signal emitted by the sample to be tested may be difficult or even impossible to detect due to being covered by objects or affected by light.

[0227] Please refer to Figure 33 In the present invention, step 033 (performing image detection on the pre-processed sequencing image) may include:

[0228] 0331: Perform edge detection on the sequencing image to obtain multiple edge points, which can enclose an abnormal area;

[0229] 0332: Accumulate along the gradient direction of multiple edge points to obtain multiple accumulation cells;

[0230] 0333: Determine the center of the abnormal area based on the largest accumulated value among multiple accumulated cells.

[0231] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 32 The first detection subunit 131 can be used to: perform edge detection on the sequencing image to obtain multiple edge points, and the multiple edge points can enclose an abnormal area; perform accumulation processing along the gradient direction of the multiple edge points to obtain multiple accumulation cells; and determine the center of the abnormal area according to the one with the largest accumulation value among the multiple accumulation cells.

[0232] In this way, the effect of detecting whether there are foreign objects in the sequencing image can be achieved.

[0233] Specifically, in step 0331, a canny edge detection method can be used to determine the grayscale value variation trend based on the grayscale values ​​of each pixel in the sequencing image. Pixels in locations with a significant grayscale value variation trend are then identified as edge points. A sudden change in grayscale value between two adjacent pixels can be considered a location with a significant variation trend. In locations with a significant grayscale value variation trend, the presence of foreign matter may darken the abnormal area. In this case, pixels with smaller grayscale values ​​can be identified as edge points. If the abnormal area is caused by overexposure, pixels with larger grayscale values ​​can be identified as edge points.

[0234] During image detection, an accumulator space can be created for the sequencing image, and the accumulator space can be configured to completely cover the sequencing image. The accumulator space can include multiple pixel cells. The pixel cells within the accumulator space can be arranged in rows and columns, and each pixel cell can correspond to a pixel point at a corresponding position in the sequencing image. Before performing pixel accumulation processing, all pixel cells can be set to 0.

[0235] In step 0332, once an edge point is obtained, a gradient direction line can be generated in the sequenced image according to the gradient direction corresponding to the edge point. The gradient direction line will pass through other pixel cells in the accumulator space. During the accumulation process, each time the gradient direction line of an edge point passes through other pixel cells, an accumulation is performed for the passed pixel cells.

[0236] The gradient direction of an edge point can be the maximum gradient direction of the edge point or the set direction of the corresponding sequencing image. The maximum gradient direction of an edge point can be the perpendicular line of the tangent line of the abnormal region enclosed by multiple edge points at the edge point. The set direction of the corresponding sequencing image can be the row direction and / or column direction formed by the arrangement of pixels in the sequencing image.

[0237] In step 0333, after the accumulation process is completed, each pixel cell that has been accumulated will be used as an accumulation cell. The center of the abnormal area can be used as a feature point of the abnormal area to indicate that there is an abnormal area at its location. For an abnormal area, its center is generally located at the perpendicular line of the tangent of most edge points. Since the accumulation cell can indicate that a gradient direction line passes through, the pixel cell corresponding to the center of the abnormal area in the accumulator space can have the largest accumulation value, and thus the accumulation cell with the largest accumulation value can be determined as the center of the abnormal area.

[0238] Please combine Figure 34 , Figure 34 The situation of determining the abnormal area and its center is shown in Figure 34 In the figure, the bold black arc is formed by sequentially connecting multiple edge points of the abnormal region, and the black dot enclosed within the arc is the center of the determined abnormal region. By highlighting the line formed by the sequential connection of multiple edge points and the center of the abnormal region, testers can determine whether the foreign body region in the sequencing image has been detected and the location of the detected foreign body region in the sequencing image, which can easily determine the accuracy of foreign body detection.

[0239] Additionally, determining the one with the maximum accumulated value among all the accumulated cells can be achieved by searching for a local maximum in the accumulator space.

[0240] In the present invention, the shape of the foreign matter in the sequencing image may be one or more of a circle, a polygon, and an ellipse. The foreign matter may include air bubbles.

[0241] It can be understood that the foreign body detection of bubbles may include detecting whether there is a circular contour in the sequencing image.

[0242] Specifically, for bubbles, the corresponding abnormal region is essentially circular, with the center of the abnormal region corresponding to the center of the circle. After all the cumulative cells are determined, the gradient direction line of each edge point will basically pass through the center of the abnormal region, so that the cumulative cell corresponding to the center of the abnormal region has the maximum value.

[0243] In addition, for other types of foreign matter, the presence of a corresponding shape outline in the sequencing image can be determined based on its specific shape, which allows those skilled in the art to combine the relevant schemes in the present invention to determine whether other types of foreign matter are present in the sequencing image.

[0244] Please refer to Figure 35 In the present invention, step 033 (performing image detection on the pre-processed sequencing image) may include:

[0245] 034: When an abnormal region is detected in the sequencing image, performing brightness detection on a brightness check region, where the brightness check region is at least a portion selected from the abnormal region;

[0246] 035: When it is determined that the brightness value in the brightness verification area is greater than a first preset multiple of the average brightness value of the sequencing image, determining that a bright spot exists in the abnormal area;

[0247] 036: When it is determined that the brightness value in the brightness verification area is less than a second preset multiple of the average brightness value of the sequenced image, determining that a black hole exists in the abnormal area;

[0248] The first preset multiple is greater than the second preset multiple.

[0249] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 36 The detection unit 13 may include a second detection subunit 132. The second detection subunit 132 may be configured to: upon detecting the presence of an abnormal region in the sequencing image, perform brightness detection on a brightness verification region, where the brightness verification region is at least a portion selected from the abnormal region; upon determining that a brightness value within the brightness verification region is greater than a first preset multiple of an average brightness value of the sequencing image, determine that a bright spot exists within the abnormal region; upon determining that a brightness value within the brightness verification region is less than a second preset multiple of the average brightness value of the sequencing image, determine that a black hole exists within the abnormal region, where the first preset multiple is greater than the second preset multiple.

[0250] In this way, the impact of uneven light distribution when acquiring sequencing images can be reduced.

[0251] Please combine Figure 37 and Figure 38 , Figure 37 This shows the presence of bright spots in the sequencing image. Figure 38The image shows the presence of black holes in the sequencing image. In practice, when capturing sequencing images, some parts of the sequencing image may appear too bright due to overexposure, and some parts of the sequencing image may appear too dark due to the presence of air at corresponding locations within the chip flow channel 21 affecting the propagation direction of light. Both of the above situations are caused by the presence of abnormal areas in the sequencing image due to uneven light distribution during the acquisition of the sequencing image. Among them, the presence of impurities in the chip flow channel 21 will cause the image to be overexposed.

[0252] Based on the above, since bright spots and black holes may not be caused by the presence of foreign matter, when it is determined that there is an abnormal area, by detecting the brightness distribution in the abnormal area, it is possible to determine whether the abnormal area is caused by a bright spot or a black hole.

[0253] Specifically, the average brightness value of the sequencing image can be determined first, and then a portion of the abnormal region can be obtained as a brightness verification region. If the abnormal region is caused by a bright spot, the brightness value in the brightness verification region will be higher and greater than a first preset multiple of the average brightness value of the sequencing image. If the abnormal region is caused by a black hole, the brightness value in the brightness verification region will be lower and less than a second preset multiple of the average brightness value of the sequencing image.

[0254] In the present invention, the first preset multiple may be greater than 1; and the second preset multiple may be less than 1.

[0255] In some cases, the value range of the first preset multiple may be [1.5, 2.5], and the value range of the second preset multiple may be [0.25, 0.75].

[0256] In the present invention, the shape of the brightness verification area may be a square, the shape of the abnormal area may be a circle, the center of the brightness verification area may be the center of the abnormal area, and the side length of the brightness verification area may be the radius of the abnormal area.

[0257] In this way, the brightness calibration area can be obtained quickly and conveniently.

[0258] It can be understood that since the sequencing image can be regarded as an array of multiple pixels arranged in rows and columns, the shape of the acquired brightness verification area is a square, and the edge of the brightness verification area can be made parallel to the arrangement direction of the pixels, and then all the pixels in the brightness verification area that need to be acquired can be determined by the corresponding pixel coordinate system.

[0259] In addition, in some cases, when the shape of the abnormal area is non-circular (such as an irregular figure), an inscribed circle can be taken in the abnormal area, and the center of the inscribed circle is used as the center of the brightness verification area, and the radius of the inscribed circle is used as the side length of the brightness verification area.

[0260] Please refer to Figure 39 In the present invention, step 03 (performing foreign body detection processing on the pre-processed sequencing image) may include:

[0261] 04: Determine the foreign body detection efficiency of the sequencing images based on the total number of sequencing images in which foreign bodies can be detected and the total number of sequencing images in which foreign bodies are actually present.

[0262] The foreign body detection method of the present invention can be implemented by the foreign body detection device 10 of the present invention. Figure 40 The foreign body detection device 10 may include a testing unit 14. The testing unit 14 may be used to determine the foreign body detection efficiency of the sequencing images based on the total number of sequencing images in which foreign bodies can be detected and the total number of sequencing images in which foreign bodies are actually present.

[0263] In this way, the accuracy of foreign body detection can be easily determined.

[0264] Specifically, please refer to Table 1, which shows the test results of foreign body detection on sequencing images according to the technical solution of the present invention in some test scenarios, and the foreign bodies are bubbles.

[0265] quantity Proportion Number of bubble picture tests 174 100% Identify bubbles 157 90.20% Identify bubbles and the number of bubbles is accurate 150 86.20%

[0266] Table 1

[0267] Of the 174 sequencing images tested with bubbles, 157 were detected with bubbles using the technical solution of the present invention, and 150 had the same number of bubbles as the actual number. The accuracy rate for detecting bubbles was 90.20%, and the accuracy rate for accurately detecting the number of bubbles was 86.20%.

[0268] According to the above content, by determining the accuracy of the detection results, it is possible to conveniently determine whether the detection efficiency of foreign matter detection performed by the present invention meets expectations, and then determine whether it can be put into use, or determine the corresponding improvement direction.

[0269] In addition, in some test scenarios, the number of sequencing images without bubbles is 200, and the number of sequencing images with bubbles determined by foreign body detection is 0, that is, no false detection occurs.

[0270] Please refer to Figure 41 A terminal device 100 of the present invention may include a memory 110 and a processor 120. The memory 110 may store a computer program. When the processor 120 executes the computer program, the steps of the foreign body detection method in any of the above cases may be implemented.

[0271] For example, when the computer program is executed by the processor 120, the foreign object detection method that can be implemented includes:

[0272] 01: Acquire a sequencing image, which is at least one image acquired by performing a base extension reaction on the sample to be tested in the sequencing chip 20;

[0273] 02: Preprocess the sequencing images;

[0274] 03: Perform foreign body detection on the pre-processed sequencing image to determine whether there are foreign bodies in the sequencing image.

[0275] The terminal device 100 detects foreign matter in the sequencing image to avoid sequencing errors caused by foreign matter when the sequencing image needs to be sequenced later, thereby ensuring the confidence level of the sequencing results.

[0276] In some cases, the terminal device 100 may include a gene sequencer. Specifically, when sequencing a sample to be tested is required, the collected sequencing image may first be inspected for foreign matter to determine the quality of the sequencing image. If the sequencing image is determined to be free of foreign matter, it indicates that the sample is not affected by the foreign matter, and the sequencing result obtained by identifying the sequencing image can have a high degree of confidence.

[0277] In addition, when determining that there are foreign objects in the sequencing image, the portion of the sequencing image containing the foreign objects can be removed first, and then the other portions of the sequencing image can be identified.

[0278] A computer-readable storage medium of the present invention may store a computer program, which, when executed by the processor 120, may implement the steps of the foreign body detection method in any of the above-mentioned cases.

[0279] For example, when the computer program is executed by the processor 120, the foreign object detection method that can be implemented includes:

[0280] 01: Acquire a sequencing image, which is at least one image acquired by performing a base extension reaction on the sample to be tested in the sequencing chip 20;

[0281] 02: Preprocess the sequencing images;

[0282] 03: Perform foreign body detection on the pre-processed sequencing image to determine whether there are foreign bodies in the sequencing image.

[0283] The computer-readable storage medium can detect foreign matter in sequencing images to avoid sequencing errors caused by foreign matter when gene sequencing is subsequently performed on the sequencing images, thereby ensuring the confidence level of the sequencing results.

[0284] The computer-readable storage medium may be provided in the terminal device 100 or in other terminals. The terminal device 100 may communicate with other terminals to obtain the corresponding program.

[0285] It is understood that computer-readable storage media may include any entity or device capable of carrying a computer program, recording media, USB flash drives, removable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media. A computer program may include computer program code. The computer program code may be in source code form, object code form, executable files, or some intermediate form.

[0286] In certain embodiments of the present invention, the units and / or sub-units involved in performing the relevant processing operations may be a single-chip microcomputer chip that integrates a processor, memory, communication module, etc. The processor may be a central processing unit (CPU), a graphics processing unit (GPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), off-the-shelf programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0287] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.

[0288] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in conjunction with such instruction execution systems, apparatuses or devices.

[0289] Although the embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments of the present invention without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. A foreign body detection method, characterized in that: include: Acquire a sequencing image, wherein the sequencing image is at least one image acquired by performing a base extension reaction on the sample to be tested in the sequencing chip; Preprocessing the sequencing image; The pre-processed sequencing image is subjected to foreign matter detection processing to determine whether foreign matter exists in the sequencing image.

2. The foreign body detection method according to claim 1, characterized in that: When a plurality of images are acquired by performing a base extension reaction on the sample to be tested in the sequencing chip, the sequencing image is an image with the strongest optical signal among the plurality of images; optionally, the sequencing image is acquired by capturing the image in the base C channel by an imaging system; Optionally, after the step of performing foreign body detection processing on the pre-processed sequencing image to determine whether foreign bodies are present in the sequencing image, the step further comprises: The foreign matter detection efficiency of the sequencing images is determined based on the total number of sequencing images in which the foreign matter can be detected and the total number of sequencing images in which the foreign matter actually exists.

3. The foreign matter detection method according to claim 1, wherein: The step of preprocessing the sequencing image includes the following a) and c): a) performing image segmentation processing on the sequencing image; c) performing image filtering processing on the sequencing image; Optionally, the step of performing image segmentation processing on the sequencing image includes: Cutting the sequencing image into a plurality of first sub-graphs according to a preset cutting path; The step of performing foreign body detection processing on the pre-processed sequencing image comprises: performing foreign object detection processing on the plurality of first sub-images; Optionally, the step of performing foreign matter detection processing on the plurality of first sub-images includes: Processing the plurality of first subgraphs in parallel by using a plurality of threads; Optionally, the direction of the preset cutting path includes a length direction and a height direction of the sequencing image, and the plurality of first sub-images can be arranged in rows along the length direction, and can be arranged in columns along the height direction; Optionally, after the step of cutting the sequencing image into a plurality of first sub-graphs according to a preset cutting path, the step further comprises: Obtaining a second sub-image according to a corresponding sliding window for an adjacent area between two adjacent first sub-images; After the step of performing foreign body detection processing on the plurality of first sub-images, the following steps are included: performing foreign object detection processing on the plurality of second sub-images; Optionally, the step length between the first subgraph and the corresponding second subgraph can be determined by the length or width of the first subgraph; or The step length between the first subgraph and the corresponding second subgraph can be determined by the difference between a window width and a maximum width of the foreign object, wherein the window width is the width of the first subgraph or the width of the second subgraph, and the maximum width of the foreign object is the maximum value of the distance between any two points on the foreign object in the sequencing image; Optionally, the step of preprocessing the sequencing image further includes the following b): b) performing image enhancement processing on the sequencing image; Optionally, the step of performing image enhancement processing on the sequencing image comprises: When performing image enhancement processing on a plurality of first sub-images, image enhancement processing is performed only on the first sub-images whose grayscale mean is less than a set grayscale value, the plurality of first sub-images being obtained by cutting the sequencing image according to a preset cutting path, and the plurality of first sub-images being capable of being arranged to form the sequencing image; Optionally, the step of performing image enhancement processing on the sequencing image comprises: performing grayscale value anomaly removal processing on pixels in the sequencing image according to the grayscale value distribution range of the sequencing image; Optionally, the step of performing grayscale value anomaly removal processing on pixels in the sequencing image according to the grayscale value distribution range of the sequencing image includes: If the grayscale value of a pixel in the sequencing image is less than a first quantile of the grayscale value distribution range, adjusting the grayscale value of the pixel to a grayscale value corresponding to the first quantile; If the grayscale value of the pixel in the sequencing image is greater than the second quantile of the grayscale value distribution range, adjusting the grayscale value of the pixel to the grayscale value corresponding to the second quantile; wherein the first quantile is smaller than the second quantile; Optionally, the step of performing image enhancement processing on the sequencing image comprises: performing normalization processing on the sequencing image so that the grayscale value distribution range of the sequencing image is transformed from the original grayscale value distribution range to the set grayscale value distribution range; Optionally, the normalization process can be achieved by the following calculation formula: in, represents the grayscale value of the pixel point of the sequencing image within the set grayscale value distribution range, x represents the grayscale value of the pixel point of the sequencing image within the original grayscale value distribution range, and x max Indicates the maximum grayscale value of the original grayscale value distribution range, x min Indicates the minimum grayscale value of the original grayscale value distribution range, x max ' represents the maximum grayscale value of the grayscale value distribution range, x min ' represents the minimum grayscale value of the set grayscale value distribution range; Optionally, the step of performing image filtering on the sequencing image includes the following steps c1) and c2): c1) performing low-pass filtering on the sequencing image; c2) performing median filtering on the sequencing image; Optionally, the step of performing low-pass filtering on the sequencing image includes: performing frequency domain transformation processing on the sequencing image to obtain a frequency spectrum of the sequencing image; Performing time domain transformation processing on the low-frequency portion of the spectrum graph to filter out high-frequency interference in the sequencing image; Optionally, the low-pass filtering process can be implemented by the following calculation formula: Wherein, f(x1, y1) represents the signal value of the pixel located at the x1th row and y1th column in the pixel array of the sequencing image, M represents the number of rows of the pixel array of the sequencing image, N represents the number of columns of the pixel array of the sequencing image, F(u1, v1) represents the frequency domain transformation result obtained by Fourier transforming f(x1, y1), F(u2, v2) represents the low-frequency part of F(u1, v1), and f(x2, y2) represents the time domain transformation result of F(u2, v2); Optionally, after the step of performing frequency domain transformation on the sequencing image to obtain a frequency spectrum of the sequencing image, the method further comprises: When the spectrum graph is obtained, a cutout is performed at the center of the spectrum graph according to a set window, and the cutout portion is used as a low-frequency portion of the spectrum graph; Optionally, the step of performing median filtering on the sequencing image includes: Performing median filtering on the sequencing image according to a set filter kernel to filter out noise in the sequencing image; Optionally, the step of performing median filtering on the sequencing image according to a set filter kernel to filter out noise in the sequencing image includes: Replacing the pixel value of the pixel point located at the center of the filter kernel with the median value of the pixel values ​​of all the pixel points in the filter kernel; Optionally, before the step of performing median filtering on the sequencing image according to the set filter kernel to filter out noise in the sequencing image, the step includes: The size of the filter kernel is determined according to the size of the sequencing image.

4. The foreign matter detection method according to claim 1, wherein: The step of performing foreign body detection processing on the pre-processed sequencing image comprises: Performing image detection on the preprocessed sequencing image to detect whether there is an abnormal area in the sequencing image, wherein the foreign matter is located in the abnormal area; Optionally, the step of performing image detection on the pre-processed sequencing image includes: Performing edge detection on the sequencing image to obtain a plurality of edge points, wherein the plurality of edge points can enclose the abnormal area; Performing accumulation processing along the gradient direction of the plurality of edge points to obtain a plurality of accumulation cells; Determine the center of the abnormal area according to the one with the largest accumulated value among the multiple accumulated cells; Optionally, the shape of the foreign matter in the sequencing image is circular; Optionally, the foreign matter includes air bubbles; Optionally, the step of performing image detection on the pre-processed sequencing image includes: When the abnormal region is detected in the sequencing image, performing brightness detection on a brightness check region, where the brightness check region is at least a portion selected from within the abnormal region; When it is determined that the brightness value in the brightness verification area is greater than a first preset multiple of the average brightness value of the sequencing image, determining that a bright spot exists in the abnormal area; When it is determined that the brightness value in the brightness verification area is less than a second preset multiple of the average brightness value of the sequencing image, determining that a black hole exists in the abnormal area; Wherein, the first preset multiple is greater than the second preset multiple; Optionally, the first preset multiple is greater than 1, and / or the second preset multiple is less than 1; Optionally, the shape of the brightness verification area is a square, the shape of the abnormal area is a circle, the center of the brightness verification area is the center of the abnormal area, and the side length of the brightness verification area is the radius of the abnormal area.

5. A foreign body detection device, characterized in that: include: an acquisition unit, configured to acquire a sequencing image, wherein the sequencing image is at least one image acquired by performing a base extension reaction on a sample to be tested in a sequencing chip; A preprocessing unit, configured to preprocess the sequencing image; The detection unit is used to perform foreign matter detection processing on the pre-processed sequencing image to determine whether foreign matter exists in the sequencing image.

6. The foreign matter detection device according to claim 5, characterized in that: When a plurality of images are acquired by performing a base extension reaction on the sample to be tested in the sequencing chip, the sequencing image is an image with the strongest optical signal among the plurality of images; optionally, the sequencing image is acquired by capturing the image in the base C channel by an imaging system; Optionally, the foreign matter detection device includes a testing unit. After the testing unit performs foreign matter detection processing on the pre-processed sequencing image to determine whether a foreign matter exists in the sequencing image, the testing unit is configured to: The foreign matter detection efficiency of the sequencing images is determined based on the total number of sequencing images in which the foreign matter can be detected and the total number of sequencing images in which the foreign matter actually exists.

7. The foreign matter detection device according to claim 5, characterized in that: The preprocessing unit includes a first preprocessing subunit and a second preprocessing subunit; The first preprocessing subunit is used to perform image segmentation processing on the sequencing image; The second preprocessing subunit is used to perform image filtering processing on the sequencing image; Optionally, the detection unit includes a first detection subunit; The first preprocessing subunit is specifically configured to cut the sequencing image into a plurality of first subgraphs according to a preset cutting path; The first detection subunit is used to perform foreign body detection processing on the multiple first sub-images; Optionally, the first detection subunit is specifically configured to perform parallel processing on the plurality of first subgraphs through a plurality of threads; Optionally, the direction of the preset cutting path includes a length direction and a height direction of the sequencing image, and the plurality of first sub-images can be arranged in rows along the length direction, and can be arranged in columns along the height direction; Optionally, after cutting the sequencing image into a plurality of first sub-graphs according to a preset cutting path, the first pre-processing sub-unit is further configured to obtain a second sub-graph according to a corresponding sliding window for an adjacent region between two adjacent first sub-graphs; After the first detection subunit performs foreign object detection processing on the plurality of first sub-images, the first detection subunit is further configured to perform foreign object detection processing on the plurality of second sub-images; Optionally, the step length between the first subgraph and the corresponding second subgraph can be determined by the length or width of the first subgraph; or The step length between the first subgraph and the corresponding second subgraph can be determined by the difference between a window width and a maximum width of the foreign object, wherein the window width is the width of the first subgraph or the width of the second subgraph, and the maximum width of the foreign object is the maximum value of the distance between any two points on the foreign object in the sequencing image; Optionally, the preprocessing unit includes a third preprocessing subunit, and the third preprocessing subunit is used to perform image enhancement processing on the sequencing image; Optionally, the third preprocessing subunit is specifically configured to, when performing image enhancement processing on a plurality of first sub-images, perform image enhancement processing only on the first sub-images whose grayscale mean is less than a set grayscale value, the plurality of first sub-images being obtained by cutting the sequencing image according to row and column lengths corresponding to a preset cutting path, and the plurality of first sub-images being capable of being arranged in rows and columns to form the sequencing image; Optionally, the third preprocessing subunit is specifically configured to perform grayscale value anomaly removal processing on pixels in the sequencing image according to a grayscale value distribution range of the sequencing image; Optionally, the third preprocessing subunit is specifically configured to: If the grayscale value of a pixel in the sequencing image is less than a first quantile of the grayscale value distribution range, adjusting the grayscale value of the pixel to a grayscale value corresponding to the first quantile; If the grayscale value of the pixel in the sequencing image is greater than the second quantile of the grayscale value distribution range, adjusting the grayscale value of the pixel to the grayscale value corresponding to the second quantile; wherein the first quantile is smaller than the second quantile; Optionally, the third preprocessing subunit is specifically configured to perform normalization processing on the sequencing image so that the grayscale value distribution range of the sequencing image is transformed from the original grayscale value distribution range to a set grayscale value distribution range; Optionally, the normalization process can be achieved by the following calculation formula: in, represents the grayscale value of the pixel point of the sequencing image within the set grayscale value distribution range, x represents the grayscale value of the pixel point of the sequencing image within the original grayscale value distribution range, and x max Indicates the maximum grayscale value of the original grayscale value distribution range, x min Indicates the minimum grayscale value of the original grayscale value distribution range, x max ' represents the maximum grayscale value of the grayscale value distribution range, x min ' represents the minimum grayscale value of the set grayscale value distribution range; Optionally, the second preprocessing subunit is specifically configured to: performing low-pass filtering on the sequencing image; performing median filtering on the sequencing image; Optionally, the second preprocessing subunit is specifically configured to: performing frequency domain transformation processing on the sequencing image to obtain a frequency spectrum of the sequencing image; Performing time domain transformation processing on the low-frequency portion of the spectrum graph to filter out high-frequency interference in the sequencing image; Optionally, the low-pass filtering process can be implemented by the following calculation formula: Wherein, f(x1, y1) represents the signal value of the pixel located at the x1th row and y1th column in the pixel array of the sequencing image, M represents the number of rows of the pixel array of the sequencing image, N represents the number of columns of the pixel array of the sequencing image, F(u1, v1) represents the frequency domain transformation result obtained by Fourier transforming f(x1, y1), F(u2, v2) represents the low-frequency part of F(u1, v1), and f(x2, y2) represents the time domain transformation result of F(u2, v2); Optionally, after the second preprocessing subunit performs frequency domain transformation processing on the sequencing image to obtain a frequency spectrum of the sequencing image, the second preprocessing subunit is further configured to: When the spectrum graph is obtained, a cutout is performed at the center of the spectrum graph according to a set window, and the cutout portion is used as a low-frequency portion of the spectrum graph; Optionally, the second preprocessing subunit is specifically configured to: Performing median filtering on the sequencing image according to a set filter kernel to filter out noise in the sequencing image; Optionally, the second preprocessing subunit is specifically configured to: Replacing the pixel value of the pixel point located at the center of the filter kernel with the median value of the pixel values ​​of all the pixel points in the filter kernel; Optionally, before the second preprocessing subunit performs median filtering on the sequencing image according to a set filter kernel to filter out noise in the sequencing image, the second preprocessing subunit is further configured to: The size of the filter kernel is determined according to the size of the sequencing image.

8. The foreign matter detection device according to claim 5, characterized in that: The detection unit includes a first detection subunit, and the first detection subunit is specifically configured to: Performing image detection on the preprocessed sequencing image to detect whether there is an abnormal area in the sequencing image, wherein the foreign matter is located in the abnormal area; Optionally, the first detection subunit is specifically configured to: Performing edge detection on the sequencing image to obtain a plurality of edge points, wherein the plurality of edge points can enclose the abnormal area; Performing accumulation processing along the gradient direction of the plurality of edge points to obtain a plurality of accumulation cells; Determine the center of the abnormal area according to the one with the largest accumulated value among the multiple accumulated cells; Optionally, the shape of the foreign matter in the sequencing image is circular; Optionally, the foreign matter includes air bubbles; Optionally, the detection unit includes a second detection subunit; After the first detection subunit performs image detection on the pre-processed sequencing image, the second detection subunit is configured to: When the abnormal region is detected in the sequencing image, performing brightness detection on a brightness check region, where the brightness check region is at least a portion selected from within the abnormal region; When it is determined that the brightness value in the brightness verification area is greater than a first preset multiple of the average brightness value of the sequencing image, determining that a bright spot exists in the abnormal area; When it is determined that the brightness value in the brightness verification area is less than a second preset multiple of the average brightness value of the sequencing image, determining that a black hole exists in the abnormal area; Wherein, the first preset multiple is greater than the second preset multiple; Optionally, the first preset multiple is greater than 1, and / or the second preset multiple is less than 1; Optionally, the shape of the brightness verification area is a square, the shape of the abnormal area is a circle, the center of the brightness verification area is the center of the abnormal area, and the side length of the brightness verification area is the radius of the abnormal area.

9. A terminal device, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the foreign matter detection method according to any one of claims 1 to 4 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the foreign matter detection method according to any one of claims 1 to 4.