Microscopic detection method and device for components of traditional Chinese medicine powder thin-layer sample
Through the combination of TransNeXt object detection model and electric scanning microscope, the problem of artificial error in the detection of Chinese medicine powder ingredients is solved, high-precision and rapid detection results are achieved, and the stability and efficiency of detection are improved.
Patent Information
- Application Number
- CN202411324724.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-03
AI Technical Summary
There is a problem of high manual judgment error in microscopic detection of Chinese medicine powder components, which leads to poor repetition and stability of the test results.
Using TransNeXt object detection model combined with an electric scanning microscope, the microscope of the thin-layer sample of Chinese medicine powder is obtained and input into the TransNeXt model to obtain category information and position information of different components. The multi-scale feature fusion network and the object detection network are used to improve detection accuracy. .
It realizes high-precision and rapid detection of Chinese medicine powder ingredients, reduces manual judgment errors, and improves the stability and efficiency of the detection results.
Smart Images

Figure CN119246580A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of traditional Chinese medicine detection, and more specifically, relates to a method and device for microscopic detection of components of a thin layer sample of traditional Chinese medicine powder. Background Art
[0002] Chinese herbal medicine slices refer to Chinese herbal medicines that have been processed according to the theory and processing methods of traditional Chinese medicine and can be directly used in clinical practice of traditional Chinese medicine. The component testing of Chinese herbal medicine slices is an important part of ensuring the quality and safety of traditional Chinese medicine.
[0003] Common methods for detecting the components of Chinese herbal medicines include chromatography, spectroscopy, mass spectrometry, etc. Chromatography separates and identifies the various components of Chinese herbal medicines by separating and detecting different substances on a chromatographic column; spectroscopy identifies and quantitatively analyzes specific components in Chinese herbal medicines through the absorption, reflection or emission characteristics of light by substances; mass spectrometry combined with chromatography technology can provide more accurate component information and structural identification. However, the components of Chinese herbal medicines are relatively complex, and the aforementioned methods have defects such as poor repeatability and stability of results, as well as slow detection speed.
[0004] Microscopic detection refers to the technology of using a microscope to carefully observe and analyze Chinese medicine powder. Based on the microscopic characteristics of cells, tissue fragments and inclusions in the Chinese medicine powder, the composition, quality and authenticity of the Chinese medicine powder are judged. Microscopic detection has the advantages of being fast, simple and effective. However, due to the relatively complex composition of Chinese herbal medicine pieces, the high similarity of the structures between different components can easily lead to judgment errors, and the professional knowledge required of the testers is high, which limits the application of microscopic detection in the detection of Chinese medicine ingredients. Summary of the invention
[0005] In view of the defects existing in the related art, the embodiments of the present application provide a method and device for microscopic detection of components of thin layer samples of traditional Chinese medicine powder, aiming to solve the problem of high error in the results of manual component detection in microscopic detection of traditional Chinese medicine components.
[0006] In a first aspect, the present application provides a method for microscopic detection of components of a thin layer sample of traditional Chinese medicine powder, comprising:
[0007] Obtaining a microscopic image of the thin layer sample of the traditional Chinese medicine powder, the microscopic image is obtained by photographing the glass slide of the thin layer sample of the traditional Chinese medicine powder to be tested by an electric scanning microscope;
[0008] Input the microscopic image into the TransNeXt object detection model to obtain the category and location information of different components in the thin layer sample of traditional Chinese medicine powder;
[0009] Among them, the TransNeXt target detection model includes an input layer, a feature extraction network, a multi-scale feature fusion network, a target detection network and an output layer; the input layer is used to cut and enhance the input microscopic image; the feature extraction network is a TransNeXt network, which is used to extract different scale features in the microscopic image output by the input layer; the multi-scale feature fusion network is used to fuse and enhance the different scale features extracted by the TransNeXt network; the target detection network is used to detect the category information of traditional Chinese medicine powder and the location information of different categories of traditional Chinese medicine powder based on the fused features; the output layer is used to output the category information and location information of different components in the detected traditional Chinese medicine powder.
[0010] In a second aspect, an embodiment of the present application further provides an electric scanning microscope, comprising: a microscope, an electric translation stage, an electric Z-axis, a camera, a controller, and a computer;
[0011] The computer is connected to the controller and the camera to control the camera to take pictures continuously;
[0012] The controller controls the electric translation stage to drive the Chinese medicine powder thin layer sample slide to move continuously in the XY direction, and controls the electric Z axis to drive the electric translation stage to move up and down to achieve focusing.
[0013] In a third aspect, the present application also provides a microscopic detection device for components of a thin layer sample of traditional Chinese medicine powder, comprising:
[0014] An acquisition module is used to acquire a microscopic image of a thin layer of a Chinese medicine powder sample. The microscopic image is obtained by photographing a glass slide of a thin layer of a Chinese medicine powder sample to be tested using an electric scanning microscope;
[0015] The detection module is used to input the microscopic image into the TransNeXt object detection model to obtain the category information and location information of different components in the thin layer sample of traditional Chinese medicine powder;
[0016] Among them, the TransNeXt target detection model includes an input layer, a feature extraction network, a multi-scale feature fusion network, a target detection network and an output layer; the input layer is used to cut and enhance the input microscopic image; the feature extraction network is a TransNeXt network, which is used to extract different scale features in the microscopic image output by the input layer; the multi-scale feature fusion network is used to fuse and enhance the different scale features extracted by the TransNeXt network; the target detection network is used to detect the category information of traditional Chinese medicine powder and the location information of different categories of traditional Chinese medicine powder based on the fused features; the output layer is used to output the category information and location information of different components in the detected traditional Chinese medicine powder.
[0017] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect.
[0018] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0019] In a sixth aspect, an embodiment of the present application further provides a computer program product, which, when executed on a processor, enables the processor to execute the method described in the first aspect or any possible implementation manner of the first aspect.
[0020] The microscopic detection method and device for the components of a thin layer sample of traditional Chinese medicine powder provided in the embodiments of the present application, by inputting a microscopic image of the thin layer sample of traditional Chinese medicine powder taken by an electric scanning microscope into a TransNeXt target detection model, obtaining the category information and position information of different components in the thin layer sample of traditional Chinese medicine powder output by the TransNeXt target detection model, and utilizing the excellent performance of the TransNeXt target detection model in high visual processing tasks to realize the application of microscopic detection method in the detection of traditional Chinese medicine components, with fast detection speed and high detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the present application or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 It is a schematic flow chart of a method for microscopic detection of components of a thin layer sample of traditional Chinese medicine powder provided in an embodiment of the present application;
[0023] Figure 2 It is a schematic diagram of the structure of the TransNeXt target detection model provided in the embodiment of the present application;
[0024] Figure 3 It is a schematic diagram of the structure of a microscopic detection device for components of a thin layer sample of traditional Chinese medicine powder provided in an embodiment of the present application;
[0025] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0027] Figure 1 : is a schematic diagram of a process for microscopic detection of components of a thin layer sample of traditional Chinese medicine powder provided in an embodiment of the present application, such as Figure 1 As shown, the method at least includes the following steps:
[0028] S101. Obtain a microscopic image of a thin layer sample of traditional Chinese medicine powder.
[0029] Specifically, the microscopic image is obtained by photographing the thin layer sample glass slide of the Chinese herbal medicine powder to be tested through an electric scanning microscope. For the same thin layer sample glass slide of the Chinese herbal medicine powder to be tested, generally multiple microscopic images are taken to obtain accurate global information.
[0030] S102. Input the microscopic image into the TransNeXt target detection model to obtain the category information and location information of different components in the Chinese medicine powder thin layer sample.
[0031] Specifically, the target detection model adopts the TransNeXt model. TransNeXt draws on the principles of biological vision systems. It is a visual backbone network that combines aggregated attention and convolutional gated linear units (GLU). It aims to solve the deep degradation effect problem of the efficient ViT (Vision Transformers) model.
[0032] The ViT model is generally composed of a self-attention layer and a multilayer perceptron (MLP) layer. The self-attention mechanism dynamically generates an affinity matrix by calculating the similarity between the query and the key in feature extraction. This global information aggregation method demonstrates excellent feature extraction capabilities without the need for inductive biases such as convolution. However, the encoder in the ViT model was originally designed for language modeling and exhibits inherent limitations in computer vision tasks. The calculation of the global affinity matrix is highly complex, which limits its application in high-resolution image features.
[0033] The TransNeXt model achieves information perception close to human foveal vision by introducing a pixel-focused attention mechanism and a convolutional GLU channel mixer, thereby improving the robustness and performance of the model. The model can well adapt to the processing requirements of high-resolution images-microscopic images, and can improve the accuracy and efficiency of visual tasks.
[0034] The TransNeXt model shows more advanced performance than similar scale models in a variety of visual tasks such as image classification, object detection and semantic segmentation. Therefore, in the embodiment of the present application, TransNeXt is used to construct an object detection model, which uses the microscopic image of the thin layer sample of Chinese medicine powder as input and the category information and location information of different Chinese medicine components in the thin layer sample of Chinese medicine powder as output.
[0035] Figure 2 is a schematic diagram of the structure of the TransNeXt target detection model provided in the embodiment of the present application, such as Figure 2 As shown in the figure, the TransNeXt target detection model includes an input layer, a feature extraction network, a multi-scale feature fusion network, a target detection network and an output layer.
[0036] Optionally, the input layer is used to cut and enhance the input microscopic image of the thin layer sample of traditional Chinese medicine powder. In the input layer, the input microscopic image is cut to a fixed size, and the microscopic image is enhanced and then input to the feature extraction network.
[0037] Optionally, the feature extraction network is a TransNeXt network, which is used to extract different scale features in the microscopic image output by the input layer. The feature extraction network takes the sheared and enhanced microscopic image output by the input layer as input, extracts and outputs different scale features of the microscopic image.
[0038] like Figure 2 As shown in the figure, the TransNeXt network includes multiple submodules stacked in sequence, and different submodules are used to extract different scale features in microscopic images; each submodule is stacked in sequence by a cascade of normalization layers (LayerNorm), aggregated attention layers (Aggregated Attention), normalization layers, and convolutional gated linear units (Convolutional GLU). Patch Embedding means first dividing a two-dimensional microscopic image into patches (Patch), and then converting it into a one-dimensional embedding (Embedding) using a linear transformation.
[0039] Optionally, the multi-scale feature fusion network is used to fuse and enhance the different scale features extracted by the TransNeXt network. The multi-scale feature fusion network fuses and enhances the different scale features output by the feature extraction network.
[0040] like Figure 2As shown in the figure, the multi-scale feature fusion network concatenates and serializes features of different scales, adds them to the positional embeddings that reflect the position information, and then inputs them into the Transformer Encoder network for feature fusion and enhancement. The multi-scale features are flattened into serialized features, and the image coordinates are converted into position vectors, which are jointly input into the stacked Transformer encoding layer. The multi-head self-attention mechanism (MHSA) of the encoding layer is used to further fuse and enhance the input features.
[0041] The MHSA attention mechanism increases the model's ability to capture complex relationships by running multiple self-attention heads in parallel. The linear transformation of the input sequence is divided into multiple heads, each of which performs self-attention operations independently, generates its own query, key, and value vectors, and calculates its own attention weights; finally, the outputs of all heads are spliced together, and the final multi-head attention feature is obtained through a linear transformation.
[0042] Optionally, the object detection network is used to detect the category information of the Chinese medicine powder and the location information of different categories of Chinese medicine powder based on the fused features. The object detection network decodes the fused features output by the multi-scale feature fusion network and outputs the predicted bounding box and category label of the Chinese medicine powder.
[0043] like Figure 2 As shown in the figure, the target detection network uses the output features of the multi-scale fusion network (including enhanced image features and corresponding positions) as the Key and Value input of the Transformer decoding layer, and uses the learnable content queries as the Query input of the Transformer decoding layer. The input features are extracted through the cross-attention mechanism of the Transformer decoding layer, and finally different feedforward networks are used to simultaneously predict the target’s bounding box and category label.
[0044] The content query is a set of learnable vectors, each of which represents a potential target. These vectors act as queries in the model and are used to query information about the target from microscopic images. The cross-attention mechanism refers to cross-calculating attention between two different sequences to obtain the correlation between them. In the Transformer encoding layer and Transformer decoding layer architecture, the Transformer decoding layer uses the output of the Transformer encoding layer as context information through the cross-attention mechanism, helping the Transformer decoding layer to focus on the information most relevant to the current decoding position when producing the output sequence. Specifically, the attention weight is obtained by calculating the similarity between the Query and the Key, and the attention weight is multiplied by the Value and summed to obtain the weighted encoding layer output.
[0045] Optionally, the output layer is used to output the category information and location information of different components in the detected Chinese medicine powder. The output layer merges the predicted category information and location information of the Chinese medicine powder into the original input microscopic image as the final output of the TransNeXt object detection model.
[0046] Optionally, the microscopic detection method of the components of the traditional Chinese medicine powder thin layer sample provided in the embodiment of the present application further includes:
[0047] Determine whether the target component exists based on the category information;
[0048] If the target component exists, the content of the target component in the traditional Chinese medicine powder thin layer sample is determined based on the position information of the target component.
[0049] Specifically, the microscopic detection method can perform qualitative and quantitative analysis on certain specific components. Based on the category information of the Chinese medicine powder output by the TransNeXt target detection model, it is determined whether the target component exists in the thin layer sample of the Chinese medicine powder. If the target component exists, its content is determined based on the location information of the target component. The location information is generally the coordinate information of the rectangular box of a certain category of Chinese medicine powder in the microscopic image.
[0050] Optionally, determining the content of the target component in the traditional Chinese medicine powder thin layer sample based on the position information of the target component includes:
[0051] determining an area of the target component based on the position information of the target component;
[0052] determining an approximate volume of the target component based on the area and the thickness of the slide, and determining an approximate mass of the target component based on the approximate volume and the density of the target component;
[0053] The content of the target component in the TCM powder thin layer sample was determined based on the approximate mass of the target component and the mass of the TCM powder thin layer sample.
[0054] Specifically, based on the position information of the target component in the microscopic image, the area of the target component is segmented; the approximate volume of the target component is estimated in combination with the area and the thickness of the slide; then the approximate mass of the target component is calculated based on the density of the target component and the estimated approximate volume; based on the approximate mass of the target component and the total mass of the Chinese medicine powder thin layer sample, the mass proportion of the target component relative to the quantitative sampling (for example, the aforementioned 0.1 g) is determined, thereby completing qualitative and quantitative analysis of the target component.
[0055] The following introduces the training process of the TransNeXt target detection model.
[0056] Optionally, the TransNeXt object detection model is trained based on the following steps:
[0057] The glass slides of the thin layer samples of the Chinese herbal medicine powder with the same thickness are photographed by an electric scanning microscope to obtain the microscopic images of the thin layer samples of the Chinese herbal medicine powder;
[0058] After preprocessing the acquired microscopic images, the categories and location information of the Chinese medicine ingredients are labeled to create a training data set;
[0059] The TransNeXt target detection model is trained based on the training data set;
[0060] Among them, different types of Chinese herbal medicine powders but with the same roughness, quality and thickness are evenly distributed on different Chinese herbal medicine powder thin layer sample slides.
[0061] Specifically, the thin layer sample glass slides of Chinese herbal medicine powder with the same thickness are photographed by an electric scanning microscope to obtain the microscopic image of the thin layer sample of Chinese herbal medicine powder. Before this, sample preparation is required:
[0062] Different types of Chinese medicinal materials (decoction pieces), preparations containing decoction piece powders, and powders, capsules, water pills, paste pills, water-honey pills, tablets, honey pills, Chinese medicine raw materials, etc. that need to be identified in terms of the properties of intracellular contents and cell wall are all dried and crushed and then passed through a No. 5 sieve. The roughness of the sieved Chinese medicine powder is 180um (±7.5um).
[0063] Optionally, the glass slides used for preparation are uniformly glass slides with one side bonded with a metal frame including but not limited to an outer frame of 75×25 mm, an inner frame of 50×20 mm, and a thickness of 0.2 mm.
[0064] The roughness of the thin layer samples of traditional Chinese medicine powder was limited to 180um (±7.5um) and the thickness was 0.2mm to avoid unclear microscopic images of training sampling and detection sampling due to sample thickness problems, thereby affecting the model training accuracy and detection accuracy.
[0065] Optionally, 0.1 g of all Chinese medicine powder samples are uniformly measured and placed on a metal frame glass slide, and samples are prepared according to the characteristics of each type of sample. After sample preparation, the samples are evenly distributed in the metal frame.
[0066] The Chinese medicine powder with the same mass and roughness is measured as required, poured onto a glass slide, sampled according to the sample preparation requirements of different samples, and then covered with a cover glass of the same thickness to obtain a thin layer sample of Chinese medicine powder with consistent thickness; the Chinese medicine powder thin layer sample slide is placed on an electric scanning microscope for automatic focus and automatic continuous photography to obtain a microscopic image of the Chinese medicine powder thin layer sample.
[0067] The collected microscopic images of the thin layer samples of traditional Chinese medicine powder are subjected to image quality assessment and filtering, image compression preprocessing, and labeling of category information and location information, thus creating a training data set.
[0068] The TransNeXt object detection model is trained with the created training data set to obtain a trained TransNeXt object detection model. Optionally, the TransNeXt object detection model is end-to-end optimized using an AdamW optimizer. Optionally, the learning rate is 0.0001 and the weight decay is 0.0001.
[0069] Optionally, in S101, a microscopic image is obtained by photographing the thin layer sample glass slide of the Chinese herbal medicine powder to be tested through an electric scanning microscope, and the electric scanning microscope includes: a microscope, an electric translation stage, an electric Z-axis, a camera, a controller and a computer; the computer connects the controller and the camera, and controls the camera to take pictures continuously; the controller controls the electric translation stage to drive the thin layer sample glass slide of the Chinese herbal medicine powder to move continuously in the XY direction, and controls the electric Z-axis to drive the electric translation stage to move up and down to achieve focusing.
[0070] Figure 3 Schematic diagram of the structure of the microscopic detection device for the composition of the thin layer sample of traditional Chinese medicine powder provided in the embodiment of the present application, such as Figure 3 As shown, the device at least includes:
[0071] An acquisition module 301 is used to acquire a microscopic image of a thin layer sample of Chinese herbal medicine powder. The microscopic image is obtained by photographing a glass slide of a thin layer sample of Chinese herbal medicine powder to be tested using an electric scanning microscope;
[0072] The detection module 302 is used to input the microscopic image into the TransNeXt target detection model to obtain the category information and location information of different components in the Chinese medicine powder thin layer sample;
[0073] Among them, the TransNeXt target detection model includes an input layer, a feature extraction network, a multi-scale feature fusion network, a target detection network and an output layer; the input layer is used to cut and enhance the input microscopic image; the feature extraction network is a TransNeXt network, which is used to extract different scale features in the microscopic image output by the input layer; the multi-scale feature fusion network is used to fuse and enhance the different scale features extracted by the TransNeXt network; the target detection network is used to detect the category information of traditional Chinese medicine powder and the location information of different categories of traditional Chinese medicine powder based on the fused features; the output layer is used to output the category information and location information of different components in the detected traditional Chinese medicine powder.
[0074] Optionally, the TransNeXt network includes multiple sub-modules stacked and cascaded in sequence, and different sub-modules are used to extract different scale features in the microscopic image; each sub-module is sequentially stacked by a cascaded normalization layer, an aggregated attention layer, a normalization layer and a convolutional gated linear unit.
[0075] Optionally, the multi-scale feature fusion network concatenates and serializes the input multi-scale features, adds them to the position embedding reflecting the position information, and inputs them together into the stacked Transformer encoder layer, and fuses and enhances the input features through the multi-head self-attention mechanism of the Transformer encoder layer.
[0076] Optionally, the object detection network uses the enhanced features and corresponding positions of the output of the multi-scale fusion network as the key and value vector inputs of the Transformer decoder layer, uses the learnable content query as the query input of the Transformer decoder layer, extracts features from the input features through the cross-attention mechanism of the Transformer decoder layer, and predicts the bounding box and category label of the target.
[0077] Optionally, the TransNeXt object detection model is trained using the AdamW optimizer.
[0078] Optionally, the TransNeXt object detection model is trained based on the following steps:
[0079] The glass slides of the thin layer samples of Chinese herbal medicine powder with the same thickness are photographed by an electric scanning microscope to obtain the microscopic images of the thin layer samples of Chinese herbal medicine powder;
[0080] After preprocessing the acquired microscopic images, the categories and location information of the Chinese medicine ingredients are labeled to create a training data set;
[0081] The TransNeXt target detection model is trained based on the training data set;
[0082] Among them, different types of Chinese herbal medicine powders but with the same roughness, quality and thickness are evenly distributed on different Chinese herbal medicine powder thin layer sample slides.
[0083] Optionally, the device further comprises a content detection module, which is used to:
[0084] Determine whether the target component exists based on the category information;
[0085] If the target component exists, the content of the target component in the traditional Chinese medicine powder thin layer sample is determined based on the position information of the target component.
[0086] Optionally, determining the content of the target component in the traditional Chinese medicine powder thin layer sample based on the position information of the target component includes:
[0087] determining an area of the target component based on the position information of the target component;
[0088] determining an approximate volume of the target component based on the area and the thickness of the slide, and determining an approximate mass of the target component based on the approximate volume and the density of the target component;
[0089] The content of the target component in the TCM powder thin layer sample was determined based on the approximate mass of the target component and the mass of the TCM powder thin layer sample.
[0090] It can be understood that the detailed functional implementation of each of the above-mentioned units / modules can be found in the introduction of the aforementioned method embodiment, and will not be repeated here.
[0091] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.
[0092] Based on the method in the above embodiment, an embodiment of the present application provides an electronic device. The device may include: at least one memory for storing programs and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the above embodiment.
[0093] Figure 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 4As shown, the electronic device may include: a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402 and the memory 403 communicate with each other through the communication bus 404. The processor 401 may call the software instructions in the memory 403 to execute the method described in the above embodiment.
[0094] In addition, the logic instructions in the above-mentioned memory 403 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0095] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0096] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0097] It is understandable that the processor in the embodiment of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0098] The method steps in the embodiments of the present application can be implemented by hardware, or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (Random Access Memory, RAM), flash memory, read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0099] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0100] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0101] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A microscopic detection method for components of a thin layer sample of traditional Chinese medicine powder, characterized in that: include: Acquire a microscopic image of the thin layer sample of the traditional Chinese medicine powder, wherein the microscopic image is obtained by photographing the glass slide of the thin layer sample of the traditional Chinese medicine powder to be tested by an electric scanning microscope; Inputting the microscopic image into the TransNeXt target detection model to obtain the category information and location information of different components in the traditional Chinese medicine powder thin layer sample; Among them, the TransNeXt target detection model includes an input layer, a feature extraction network, a multi-scale feature fusion network, a target detection network and an output layer; the input layer is used to cut and enhance the input microscopic image; the feature extraction network is a TransNeXt network, which is used to extract different scale features in the microscopic image output by the input layer; the multi-scale feature fusion network is used to fuse and enhance the different scale features extracted by the TransNeXt network; the target detection network is used to detect the category information of traditional Chinese medicine powder and the location information of different categories of traditional Chinese medicine powder based on the fused features; the output layer is used to output the category information and location information of different components in the detected traditional Chinese medicine powder.
2. The microscopic detection method according to claim 1, characterized in that: The TransNeXt network includes a plurality of submodules stacked and cascaded in sequence, and different submodules are used to extract features of different scales in microscopic images; each submodule is stacked in sequence by a cascaded normalization layer, an aggregated attention layer, a normalization layer and a convolutional gated linear unit.
3. The microscopic detection method according to claim 1, characterized in that: The multi-scale feature fusion network concatenates and serializes the input multi-scale features, adds them to the position embedding reflecting the position information, and then inputs them into the stacked Transformer encoder layer. The input features are fused and enhanced through the multi-head self-attention mechanism of the Transformer encoder layer.
4. The microscopic detection method according to claim 1, characterized in that: The object detection network uses the enhanced features and corresponding positions of the output of the multi-scale fusion network as the key and value vector inputs of the Transformer decoder layer, uses the learnable content query as the query input of the Transformer decoder layer, extracts features from the input features through the cross-attention mechanism of the Transformer decoder layer, and predicts the bounding box and category label of the object.
5. The microscopic detection method according to claim 1, characterized in that: The TransNeXt target detection model is optimized using the AdamW optimizer.
6. The microscopic detection method according to claim 1, characterized in that: The TransNeXt object detection model is trained based on the following steps: The glass slides of the thin layer samples of Chinese herbal medicine powder with the same thickness are photographed by an electric scanning microscope to obtain the microscopic images of the thin layer samples of Chinese herbal medicine powder; After preprocessing the acquired microscopic images, the categories and location information of the Chinese medicine ingredients are labeled to create a training data set; The TransNeXt target detection model is obtained by training based on the training data set; Among them, different types of Chinese herbal medicine powders but with the same roughness, quality and thickness are evenly distributed on different Chinese herbal medicine powder thin layer sample slides.
7. The microscopic detection method according to claim 1, characterized in that: The method further comprises: Determining whether a target component exists based on the category information; If the target component exists, the content of the target component in the traditional Chinese medicine powder thin layer sample is determined based on the position information of the target component.
8. The microscopic detection method according to claim 7, characterized in that: The step of determining the content of the target component in the traditional Chinese medicine powder thin layer sample based on the position information of the target component comprises: determining the area of the target component based on the position information of the target component; determining an approximate volume of the target component based on the area and the thickness of the slide, and determining an approximate mass of the target component based on the approximate volume and the density of the target component; Based on the approximate mass of the target component and the mass of the Chinese medicine powder thin layer sample, the content of the target component in the Chinese medicine powder thin layer sample is determined.
9. An electric scanning microscope for the microscopic detection method of the components of the thin layer sample of traditional Chinese medicine powder according to any one of claims 1 to 8, characterized in that: include: Microscope, motorized translation stage, motorized Z-axis, camera, controller, and computer; The computer is connected to the controller and the camera to control the camera to take photos continuously; The controller controls the electric translation stage to drive the Chinese medicine powder thin layer sample slide to move continuously in the XY direction, and controls the electric Z axis to drive the electric translation stage to move up and down to achieve focusing.
10. A microscopic detection device for components of a thin layer sample of traditional Chinese medicine powder, characterized in that: include: An acquisition module is used to acquire a microscopic image of a thin layer sample of traditional Chinese medicine powder, wherein the microscopic image is obtained by photographing a glass slide of a thin layer sample of traditional Chinese medicine powder to be tested through an electric scanning microscope; A detection module, used for inputting the microscopic image into the TransNeXt target detection model to obtain the category information and location information of different components in the traditional Chinese medicine powder thin layer sample; Among them, the TransNeXt target detection model includes an input layer, a feature extraction network, a multi-scale feature fusion network, a target detection network and an output layer; the input layer is used to cut and enhance the input microscopic image; the feature extraction network is a TransNeXt network, which is used to extract different scale features in the microscopic image output by the input layer; the multi-scale feature fusion network is used to fuse and enhance the different scale features extracted by the TransNeXt network; the target detection network is used to detect the category information of traditional Chinese medicine powder and the location information of different categories of traditional Chinese medicine powder based on the fused features; the output layer is used to output the category information and location information of different components in the detected traditional Chinese medicine powder.
Citation Information
Cited By
AI authenticity identification method and system based on traditional Chinese medicine powder microscopic image
CN122336743A