A method and device for acquiring blood vessel images based on endoscope
By acquiring endoscopic blood vessel images under different light source conditions and performing automated processing, using feature extraction networks and deep learning models, the problem of insufficient accuracy in endoscopic blood vessel image recognition is solved, and the recognition efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202310858675.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-13
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2043-07-13
AI Technical Summary
The recognition of endoscopic blood vessel images in the existing technology is not accurate enough, causing users to spend a lot of time on auxiliary recognition.
By acquiring blood vessel images under different light source conditions, and using feature extraction networks, grayscale processing, morphological operations and deep learning models to automate image processing and analysis, target blood vessel area images are generated.
It improves the efficiency and consistency of blood vessel image recognition, reduces the subjectivity and tediousness of manual assisted recognition, provides more accurate blood vessel information, and helps users better observe and evaluate the shape and characteristics of blood vessels.
Smart Images

Figure CN116934697B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to an endoscope-based vascular image acquisition method and device. Background Art
[0002] An endoscope is a medical device used to examine and diagnose internal organs and tissues of the human body. An endoscope is usually composed of a soft fiber beam, a camera, and a light. It can provide microscopic details to help users make accurate diagnoses and treatments. Early lesions and surgical lesions require automatic recognition to reduce the user's workload. Currently, the recognition of endoscopic vascular images is not accurate enough, which requires users to spend a lot of time to assist in recognition. Summary of the invention
[0003] The main purpose of the present invention is to provide a method and device for acquiring vascular images based on an endoscope, aiming to solve the problem that the current recognition of endoscopic vascular images is not accurate enough, resulting in users having to spend a lot of time to assist in the recognition.
[0004] The present invention provides a method for acquiring a blood vessel image based on an endoscope, comprising:
[0005] Acquiring a first blood vessel image through an endoscope under a first light source condition, and acquiring a second blood vessel image through an endoscope under a second light source condition;
[0006] Inputting the first blood vessel image and the second blood vessel image into a preset feature extraction network respectively to obtain a first feature vector and a second feature vector respectively;
[0007] The first eigenvector and the second eigenvector are respectively converted into a first grayscale image and a second grayscale image by a preset grayscale method, and the grayscale image is obtained according to the formula Calculate a first pixel average value and a second pixel average value of a first grayscale image and a second grayscale image; wherein H represents the height of the grayscale image, W represents the width of the grayscale image, and P(x, y) represents the pixel value at a position where the width is x and the height is y;
[0008] According to the formula Preprocessing the first grayscale image and the second grayscale image to obtain a first preprocessed image and a second preprocessed image;
[0009] Performing morphological corrosion on the first preprocessed image and the second preprocessed image, and bridging discontinuous parts of the first preprocessed image and the second preprocessed image by a morphological dilation method, so as to obtain a first target image and a second target image;
[0010] Calculating the Hadamard product of the first target image and the first eigenvector to obtain a first eigenimage, and calculating the Hadamard product of the second target image and the second eigenvector to obtain a second eigenimage;
[0011] The first feature image and the second feature image are input into a preset feature extraction model to obtain a target blood vessel region image.
[0012] Furthermore, the step of inputting the first feature image and the second feature image into a preset feature extraction model to obtain a target blood vessel region image includes:
[0013] Collecting a third characteristic image under normal light source;
[0014] Input the first feature image and the second feature image into the first sub-model Calculate and obtain the first output result of the first sub-model; and input the second feature image into the second sub-model Calculate and obtain the second output result; where g θ represents the first output result of the first sub-model, represents the second output result of the second sub-model, i=1 or 2; r1 represents the first feature image, r2 represents the second feature image, r3 represents the third feature image,
[0015] According to the formula The first output result and the second output result are corrected to make the first output result and the second output result consistent, thereby obtaining a corrected first output result, wherein the first output result is a target blood vessel region image; It means taking the minimum value of θ under the premise of satisfying the above formula and The maximum value of O G,D is an intermediate value.
[0016] Furthermore, the steps of acquiring a first blood vessel image through an endoscope under a first light source condition and acquiring a second blood vessel image through an endoscope under a second light source condition include:
[0017] Call the preset hyperspectral camera and place the target to be detected under the preset first light environment;
[0018] Using a preset light splitting device, the reflected light of the target to be detected under a preset light environment is divided into a first light source and a second light source;
[0019] Switching the first light source to enable the hyperspectral camera in the hyperspectral camera to acquire the first blood vessel image;
[0020] The second light source is switched to enable the hyperspectral camera in the hyperspectral camera to acquire the second blood vessel image.
[0021] Furthermore, the feature extraction network includes: an input layer, a hidden layer and an output layer; the step of inputting the first vascular image and the second vascular image into a preset feature extraction network to obtain a first feature vector and a second feature vector respectively includes:
[0022] inputting the first blood vessel image and the second blood vessel image into the input layer of the corresponding feature extraction network respectively;
[0023] Performing nonlinear processing on the first blood vessel image and the second blood vessel image inputted by the input layer by using an activation function through a hidden layer to obtain a fitting result;
[0024] The fitting result is outputted through an output layer, and the first feature vector and the second feature vector corresponding to the first blood vessel image and the second blood vessel image are outputted.
[0025] Furthermore, after the step of inputting the first feature image and the second feature image into a preset feature extraction model to obtain a target blood vessel region image, the method further includes:
[0026] Extracting the type and geometric information of each feature in the first feature image and the second feature image by a preset method;
[0027] The type and geometric information of each feature is obtained and input into a preset support vector machine to obtain the blood vessel features;
[0028] Inputting the blood vessel features into a pre-trained classifier to obtain classification and semantic annotation of the blood vessel features;
[0029] The classification and semantic annotation of the blood vessel features are added to the target blood vessel region image to obtain a labeled target blood vessel image.
[0030] The present invention also provides an endoscope-based vascular image acquisition device, comprising:
[0031] An acquisition module, used to acquire a first blood vessel image through an endoscope under a first light source condition, and to acquire a second blood vessel image through an endoscope under a second light source condition;
[0032] A first input module, used to input the first blood vessel image and the second blood vessel image into a preset feature extraction network, respectively, to obtain a first feature vector and a second feature vector, respectively;
[0033] A conversion module is used to convert the first eigenvector and the second eigenvector into a first grayscale image and a second grayscale image respectively by a preset grayscale method, and convert the first eigenvector and the second eigenvector into a first grayscale image and a second grayscale image according to the formula Calculate a first pixel average value and a second pixel average value of a first grayscale image and a second grayscale image; wherein H represents the height of the grayscale image, W represents the width of the grayscale image, and P(x, y) represents the pixel value at a position where the width is x and the height is y;
[0034] The preprocessing module is used to Preprocessing the first grayscale image and the second grayscale image to obtain a first preprocessed image and a second preprocessed image;
[0035] A morphological erosion module, configured to perform morphological erosion on the first preprocessed image and the second preprocessed image, and bridge discontinuous parts of the first preprocessed image and the second preprocessed image by a morphological dilation method to obtain a first target image and a second target image;
[0036] a calculation module, configured to calculate a Hadamard product of the first target image and the first eigenvector to obtain a first eigenimage, and to calculate a Hadamard product of the second target image and the second eigenvector to obtain a second eigenimage;
[0037] The second input module is used to input the first feature image and the second feature image into a preset feature extraction model to obtain a target blood vessel region image.
[0038] Furthermore, the second input module includes:
[0039] A collection submodule, used for collecting the third characteristic image under normal light source;
[0040] An input submodule, used to input the first feature image and the second feature image into a first submodel Calculate and obtain the first output result of the first sub-model; and input the second feature image into the second sub-model Calculate and obtain the second output result; where g θ represents the first output result of the first sub-model, represents the second output result of the second sub-model, i=1 or 2; r1 represents the first feature image, r2 represents the second feature image, r3 represents the third feature image,
[0041] Correction submodule for The first output result and the second output result are corrected to make the first output result and the second output result consistent, thereby obtaining a corrected first output result, wherein the first output result is a target blood vessel region image; It means taking the minimum value of θ under the premise of satisfying the above formula and The maximum value of O G,D is an intermediate value.
[0042] Furthermore, the acquisition module includes:
[0043] A calling submodule is used to call a preset hyperspectral camera and place the target to be detected under a preset first light environment;
[0044] A division submodule, used to divide the reflected light of the target to be detected under a preset light environment into a first light source and a second light source by using a preset light splitting device;
[0045] A first switching submodule, configured to switch a first light source so that a hyperspectral camera in the hyperspectral camera acquires the first blood vessel image;
[0046] The second switching submodule is used to switch the second light source so that the hyperspectral camera in the hyperspectral camera acquires the second blood vessel image.
[0047] Furthermore, the feature extraction network includes: an input layer, a hidden layer and an output layer; the first input module includes:
[0048] A blood vessel image input submodule, used for inputting the first blood vessel image and the second blood vessel image into the input layer of the corresponding feature extraction network respectively;
[0049] a processing submodule, configured to perform nonlinear processing on the first blood vessel image and the second blood vessel image inputted by the input layer by using an activation function through a hidden layer to obtain a fitting result;
[0050] The output submodule is used to output the fitting result through an output layer, and output the first feature vector and the second feature vector corresponding to the first blood vessel image and the second blood vessel image.
[0051] Furthermore, the endoscope-based vascular image acquisition device further includes:
[0052] An extraction module, used to extract the type and geometric information of each feature in the first feature image and the second feature image by a preset method;
[0053] An information input module is used to obtain the type and geometric information of each feature and input it into a preset support vector machine to obtain blood vessel features;
[0054] A feature input module, used to input the blood vessel features into a pre-trained classifier to obtain classification and semantic annotation of the blood vessel features;
[0055] The adding module is used to add the classification and semantic annotation of the blood vessel features to the target blood vessel region image to obtain a labeled target blood vessel image.
[0056] The beneficial effects of the present invention are as follows: Based on the first vascular image and the second vascular image obtained under two light sources, by processing them, automating the image processing and analysis, the user can save a lot of time and energy, and avoid the subjectivity and tediousness of manual assisted identification. This method can improve the efficiency and consistency of identifying vascular images, and provide users with higher recognition accuracy. Such an image processing method can provide more accurate vascular information, better observe and evaluate the morphology and characteristics of the blood vessels, and thus obtain the target vascular image. This solves the problem that the current recognition of endoscopic vascular images is not accurate enough, resulting in the user spending a lot of time to assist in the recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a flowchart of a method for acquiring a blood vessel image based on an endoscope according to an embodiment of the present invention;
[0058] Figure 2 is a schematic structural block diagram of a blood vessel image acquisition device based on an endoscope according to an embodiment of the present invention;
[0059] Figure 3 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.
[0060] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0062] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly. The connection can be a direct connection or an indirect connection.
[0063] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone.
[0064] In addition, in the present invention, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0065] Reference Figure 1 The present invention proposes a method for acquiring a vascular image based on an endoscope, comprising:
[0066] S1: acquiring a first blood vessel image through an endoscope under a first light source condition, and acquiring a second blood vessel image through an endoscope under a second light source condition;
[0067] S2: inputting the first blood vessel image and the second blood vessel image into a preset feature extraction network respectively to obtain a first feature vector and a second feature vector respectively;
[0068] S3: Convert the first eigenvector and the second eigenvector into a first grayscale image and a second grayscale image respectively by a preset grayscale method, and convert the first eigenvector and the second eigenvector into a first grayscale image and a second grayscale image according to the formula Calculate a first pixel average value and a second pixel average value of a first grayscale image and a second grayscale image; wherein H represents the height of the grayscale image, W represents the width of the grayscale image, and P(x, y) represents the pixel value at a position where the width is x and the height is y;
[0069] S4: According to the formula Preprocessing the first grayscale image and the second grayscale image to obtain a first preprocessed image and a second preprocessed image;
[0070] S5: performing morphological corrosion on the first preprocessed image and the second preprocessed image, and bridging discontinuous parts of the first preprocessed image and the second preprocessed image by a morphological dilation method to obtain a first target image and a second target image;
[0071] S6: calculating the Hadamard product of the first target image and the first eigenvector to obtain a first eigenimage, and calculating the Hadamard product of the second target image and the second eigenvector to obtain a second eigenimage;
[0072] S7: Inputting the first feature image and the second feature image into a preset feature extraction model to obtain a target blood vessel region image.
[0073] As described in step S1 above, obtaining vascular images through different light sources is a common endoscopic application. Multiple light sources can be used to obtain different perspectives and more comprehensive information. By switching different light sources, different vascular images can be obtained, thereby helping users observe and evaluate the condition of blood vessels. Such technology is commonly used in endoscopic examinations in the fields of cardiovascular system, digestive tract and urinary tract. The use of multiple light sources can provide more details and visual information, thereby helping users to make accurate diagnosis and treatment decisions. It should be noted that the present application obtains vascular area images. Therefore, the light source uses RGB color, and the value of the R channel needs to be set to 0, so as to obtain two light sources. In a specific embodiment, RGB (0, 255, 0) and RGB (0, 0, 255) can be used for irradiation.
[0074] As described in step S2 above, the first vascular image and the second vascular image are respectively input into a preset feature extraction network to obtain a first feature vector and a second feature vector respectively; through the feature extraction network, the vascular features in the image will be extracted and converted into numerical feature vectors. These feature vectors can help users better understand and compare the differences between different vascular images, and may be used for further analysis and research. The feature extraction network can be a neural network model. In deep learning, the feature extraction network is usually a convolutional neural network (CNNs) or a recurrent neural network. The design of the feature extraction network takes into account the local and global features in the image, and extracts and characterizes different types of vascular features through training.
[0075] As described in step S3 above, the first eigenvector and the second eigenvector are respectively converted into a first grayscale image and a second grayscale image by a preset grayscale method, and the grayscale image is converted into a first grayscale image and a second grayscale image according to the formula Calculate the first pixel average and the second pixel average of the first grayscale image and the second grayscale image. Grayscale is the process of converting a color image into a grayscale image, which converts the color information in the image into grayscale brightness information. By converting the feature vector into a grayscale image, you can better focus on the brightness and grayscale level of the image while ignoring the color information. The grayscale image can better highlight the brightness changes and detail information in the vascular image, which is convenient for subsequent processing and analysis. The preset grayscale method usually takes into account factors such as the brightness range and contrast of the image to ensure that the generated grayscale image can accurately reflect the information in the original feature vector.
[0076] As described in step S4 above, the first grayscale image and the second grayscale image are preprocessed to obtain a first preprocessed image and a second preprocessed image. The goal of the preprocessing is to eliminate noise in the image, enhance contrast, smooth the image, etc. Specific preprocessing steps may include operations such as image filtering, sharpening, histogram equalization, and noise reduction. Through preprocessing, the clarity of the image can be improved, the vascular structure can be highlighted, and the impact of noise on image analysis can be reduced. The first preprocessed image and the second preprocessed image will provide a better basis for subsequent image analysis and research. The actual preprocessing steps may vary depending on the specific application and algorithm, but the overall goal is to make the image easier to analyze and understand through a series of operations.
[0077] As described in step S5 above, the first preprocessed image and the second preprocessed image are morphologically eroded, and the discontinuous parts of the first preprocessed image and the second preprocessed image are bridged by the morphological dilation method to obtain the first target image and the second target image. Morphological erosion is an image processing operation. By performing a local minimum operation on the pixels in the image, smaller details and noise in the image can be eliminated, thereby obtaining a clearer vascular structure. By bridging the discontinuous parts in the binary image by the morphological dilation method, the gaps that may exist in the vascular image can be connected and filled. Morphological dilation is an image processing operation. By performing a dilation operation on the pixels, the white areas in the image can be expanded and connected, thereby eliminating the gaps and extracting the complete vascular structure. Through the morphological erosion and morphological dilation operations, the first target image and the second target image can be obtained. These images will more accurately show the continuity and shape characteristics of the blood vessels, and provide more useful information for subsequent analysis and diagnosis. The specific morphological operation parameters and methods will vary according to the specific application and algorithm.
[0078] As described in step S6 above, the Hadamard product of the first target image and the first eigenvector is calculated to obtain the first eigenimage, and the Hadamard product of the second target image and the second eigenvector is calculated to obtain the second eigenimage; the Hadamard product is also called element-wise multiplication, which is an operation of multiplying corresponding elements. The first eigenimage can be obtained by multiplying the corresponding elements of the first target image and the first eigenvector. This can highlight the information related to the corresponding eigenvector at a specific position in the vascular image, while weakening other irrelevant information.
[0079] Similarly, performing a Hadamard product operation on the second target image and the second eigenvector is also a common calculation method. This can obtain a second eigenimage, which contains position and feature information related to the second eigenvector. These eigenimages can serve as the basis for subsequent analysis and research, helping users to further observe and evaluate the morphology and characteristics of blood vessels.
[0080] It should be noted that the Hadamard product operation requires the first target image and the first eigenvector as well as the second target image and the second eigenvector to have the same size and dimension. Ensuring that the input data format is correct is an important step to ensure the correctness of the calculation.
[0081] As described in step S7 above, the feature extraction model is usually based on a deep learning method, such as a convolutional neural network (CNN), and has undergone a lot of training and optimization. These models can understand and capture complex local and global features in the image to extract information about a specific target. By inputting the first feature image and the second feature image into the feature extraction model, the corresponding target vascular area image can be obtained from it for further analysis and diagnosis. The specific feature extraction model design and configuration will vary according to the specific application and algorithm. In a specific embodiment, the present application provides a specific vascular extraction method, which is described in detail later and will not be repeated here. Thus, based on the acquisition of the first vascular image and the second vascular image under two light sources, by processing them, automating the image processing and analysis, the user can save a lot of time and energy, and avoid the subjectivity and cumbersomeness of manual auxiliary identification. This method can improve the efficiency and consistency of identifying vascular images, provide users with more accurate diagnosis and treatment decision-making basis, and such an image processing method can provide more accurate vascular information, help users better observe and evaluate the morphology and characteristics of blood vessels, and obtain the target vascular image, which solves the problem that the current recognition of endoscopic vascular images is not accurate enough, resulting in the need for users to spend a lot of time to assist in identification.
[0082] In one embodiment, the step S7 of inputting the first feature image and the second feature image into a preset feature extraction model to obtain a target blood vessel region image includes:
[0083] S701: Acquire a third characteristic image under a normal light source;
[0084] S702: Input the first feature image and the second feature image into a first sub-model Calculate and obtain the first output result of the first sub-model; and input the second feature image into the second sub-model Calculate and obtain the second output result; where g θ represents the first output result of the first sub-model, represents the second output result of the second sub-model, i=1 or 2; r1 represents the first feature image, r2 represents the second feature image, r3 represents the third feature image,
[0085] S703: According to the formula The first output result and the second output result are corrected to make the first output result and the second output result consistent, thereby obtaining a corrected first output result, wherein the first output result is a target blood vessel region image; It means taking the minimum value of θ under the premise of satisfying the above formula and The maximum value of O G,D is an intermediate value.
[0086] As described in step S701 above, a normal light source refers to a light source used in the prior art, and the specific form is not limited, that is, the light source used by a general endoscope. The light source used by an endoscope is usually a white light source with moderate intensity, brightness and color temperature. Such a light source helps to provide a clear and natural visual effect of tissues and lesions to help users accurately locate and diagnose. Various technologies and devices can provide different types of white light sources, including traditional xenon ion lamps, LED (light emitting diode) lamps, etc. These light sources can provide appropriate light brightness, color temperature and color reproduction in endoscopic applications to meet the user's observation needs. Endoscope manufacturers usually provide detailed information on light source types and performance in their equipment specifications and instructions.
[0087] As described in the above steps S702-S703, by formula The first output result is obtained, and then the second feature image is input into the second sub-model to obtain the second output result. Since the first feature image and the second feature image only differ in the light source, the output results of the two models are expected to be consistent, which can improve the recognition accuracy of the model. The first feature image and the second feature image only differ in the light source, so these differences should not affect the model's recognition of vascular areas. Therefore, by maintaining the model's robustness to these light source differences, the model can better adapt to different inputs and achieve higher accuracy and stability under different lighting conditions. However, it should be noted that during the model design and training process, it is necessary to ensure that the model can capture subtle changes brought about by light source differences. This can be achieved by using a sufficiently diverse data set and a suitable training strategy. In order to make the model's discrimination effect better, the intermediate generation model parameter set θ should be minimized as much as possible, and the intermediate discrimination model parameter set θ should be minimized as much as possible. Take the maximum value.
[0088] In one embodiment, the step S1 of acquiring a first blood vessel image through an endoscope under a first light source condition and acquiring a second blood vessel image through an endoscope under a second light source condition comprises:
[0089] S101: calling a preset hyperspectral camera and placing the target to be detected under a preset first light environment;
[0090] S102: using a preset light splitting device to divide the reflected light of the target to be detected under a preset light environment into a first light source and a second light source;
[0091] S103: Switching the first light source to enable the hyperspectral camera in the hyperspectral camera to acquire the first blood vessel image;
[0092] S104: Switching the second light source to enable the hyperspectral camera in the hyperspectral camera to acquire the second blood vessel image.
[0093] As described in step S101 above, the hyperspectral camera can capture the reflected spectral information of the target in many discrete bands, providing more spectral dimensions. Placing the target to be detected in a preset first light environment may be to obtain a consistent light source and environment under specific lighting conditions to ensure the comparability and consistency of the data. In this case, the hyperspectral camera can be used to capture the spectral response of the target in different bands, thereby providing richer data for subsequent target detection, classification or other analysis tasks. By analyzing the spectral data, the spectral signature of the target and the characteristics associated with it can be obtained. This information can be used for applications such as target identification, positioning and classification. It should be noted that when operating the hyperspectral camera, it may be necessary to set and configure it according to the specifications and requirements of the specific equipment. Ensure that the camera parameters and environmental settings are as expected to obtain accurate and reliable hyperspectral data. In addition, in addition to the first light environment, it may be necessary to collect data under multiple different light environments to obtain more comprehensive and robust spectral information.
[0094] As described in step S102 above, the reflected light of the target to be detected under a preset light environment is divided into a first light source and a second light source. The spectroscopic device can separate and divide the incident light according to different wavelengths or colors. In this way, the reflected light of the target to be detected at different wavelengths or colors can be separated as the first light source and the second light source respectively. The purpose of doing this may be to extract the characteristics of the target in different spectral ranges and to perform more accurate identification and analysis. The spectroscopic device is usually based on optical principles, such as a prism or a grating, to separate the incident light according to wavelength and guide it to different targets or detection channels through different optical paths. By separating the reflected light of the target, its spectral information under illumination conditions of different wavelengths or colors can be obtained. It should be noted that the setting and configuration of the spectroscopic device may need to be adjusted according to the specific application and experimental requirements. Ensure that the spectroscopic device can provide accurate spectral separation and image acquisition, and ensure that the selected wavelength range and division method are suitable for the identification and analysis of the target.
[0095] As described in the above steps S103-S104, by switching different light sources, the spectral composition and intensity distribution of the incident light can be changed, thereby obtaining different vascular images. The first vascular image is acquired under the preset first light source conditions, and the second vascular image is acquired under the preset second light source conditions. The purpose of doing this may be to explore and compare the characteristics and changes of vascular images under different lighting conditions. By analyzing the differences and commonalities between the two vascular images, more comprehensive vascular information can be obtained, and help improve the accuracy of vascular identification and analysis. It should be noted that when switching the light source, it should be ensured that the hyperspectral camera can accurately acquire the corresponding vascular image after each light source is switched. This may involve calibration and setting camera parameters to ensure the accuracy and consistency of image acquisition and spectral shooting. In addition, there may be certain differences in images under different light sources, and appropriate image preprocessing and calibration are required to improve the comparability and reliability of vascular images.
[0096] In one embodiment, the feature extraction network includes: an input layer, a hidden layer, and an output layer; the step S2 of inputting the first vascular image and the second vascular image into a preset feature extraction network to obtain a first feature vector and a second feature vector respectively includes:
[0097] S201: inputting the first blood vessel image and the second blood vessel image into the input layer of the corresponding feature extraction network respectively;
[0098] S202: performing nonlinear processing on the first blood vessel image and the second blood vessel image input by the input layer by using an activation function through a hidden layer to obtain a fitting result;
[0099] S203: Outputting the fitting result through an output layer, and outputting the first eigenvector and the second eigenvector corresponding to the first blood vessel image and the second blood vessel image.
[0100] As described in step S201 above, in this structure, the input layer is the initial layer of the network, which is used to receive input data. The first vascular image and the second vascular image are respectively input into the corresponding input layers, so that they are used as the input of the network. The hidden layer is the core part of the feature extraction network. It is responsible for feature extraction and representation learning of the input data through a series of calculations and transformations. These hidden layers usually contain multiple neurons and activation functions, and high-level features of the input data can be extracted through learning. The output layer is the last layer of the feature extraction network, which produces the final output of the network. The output layer can be designed according to specific task requirements, such as classification, regression or other tasks. By inputting the first vascular image and the second vascular image into the input layers of the corresponding feature extraction network respectively, the feature representations of the two images can be extracted respectively. These features can be used for subsequent target recognition, classification or other analysis tasks.
[0101] As described in the above steps S202-S203, the activation function of the hidden layer can cause the input data to change in the nonlinear space, thereby extracting more complex and advanced features. This nonlinear processing can help the model better capture the features and patterns of the input image. The output layer is responsible for mapping the fitting results of the hidden layer to the final feature representation. The output layer can be used to convert the output of the hidden layer into a first feature vector and a second feature vector corresponding to the first vascular image and the second vascular image. These feature vectors may contain digital or vector values representing image features. In summary, through the nonlinear processing of the hidden layer and the mapping of the output layer, the first vascular image and the second vascular image can be converted into corresponding feature vector representations. These feature vectors can be used for subsequent model analysis, classification or other tasks. It is necessary to select an appropriate network architecture, activation function and output representation method according to the specific application and task to obtain the best feature extraction and performance.
[0102] In one embodiment, after the step S7 of inputting the first feature image and the second feature image into a preset feature extraction model to obtain the target blood vessel region image, the method further includes:
[0103] S701: extracting the type and geometric information of each feature in the first feature image and the second feature image by a preset method;
[0104] S702: Obtain the type and geometric information of each feature and input it into a preset support vector machine to obtain blood vessel features;
[0105] S703: Inputting the blood vessel features into a pre-trained classifier to obtain classification and semantic annotation of the blood vessel features;
[0106] S704: adding the classification and semantic annotation of the blood vessel features to the target blood vessel region image to obtain a labeled target blood vessel image.
[0107] As described in the above steps S701-S704, support vector machine is a common machine learning algorithm used for classification and regression tasks. By inputting the type and geometric information of each feature, the support vector machine can learn the feature space of the vascular feature and perform classification. By inputting the vascular feature into a pre-trained classifier, the classification and semantic annotation of the vascular feature can be obtained. The pre-trained classifier can extract and analyze the characteristic pattern of the blood vessel by learning a large amount of vascular feature data, and make accurate classification predictions. The classification and semantic annotation of the vascular feature are added to the target vascular area image to obtain the annotated target vascular image. Such an annotation result can help further analyze and understand the structure and characteristics of the blood vessel. It should be noted that the methods and algorithms of each step may need to be adjusted and optimized according to the specific application and data. By comprehensively utilizing support vector machines, pre-trained classifiers and other related algorithms, feature extraction, classification and annotation of vascular images can be achieved, thereby obtaining a more accurate and comprehensive target vascular image.
[0108] Reference Figure 2 The present invention also provides a blood vessel image acquisition device based on an endoscope, comprising:
[0109] An acquisition module 10, configured to acquire a first blood vessel image through an endoscope under a first light source condition, and acquire a second blood vessel image through an endoscope under a second light source condition;
[0110] A first input module 20, used to input the first blood vessel image and the second blood vessel image into a preset feature extraction network, respectively, to obtain a first feature vector and a second feature vector, respectively;
[0111] The conversion module 30 is used to convert the first feature vector and the second feature vector into a first grayscale image and a second grayscale image respectively by a preset grayscale method, and convert the first feature vector and the second feature vector into a first grayscale image and a second grayscale image according to the formula Calculate a first pixel average value and a second pixel average value of a first grayscale image and a second grayscale image; wherein H represents the height of the grayscale image, W represents the width of the grayscale image, and P(x, y) represents the pixel value at a position where the width is x and the height is y;
[0112] The preprocessing module 40 is used to Preprocessing the first grayscale image and the second grayscale image to obtain a first preprocessed image and a second preprocessed image;
[0113] A morphological erosion module 50, configured to perform morphological erosion on the first preprocessed image and the second preprocessed image, and bridge discontinuous parts of the first preprocessed image and the second preprocessed image by a morphological dilation method to obtain a first target image and a second target image;
[0114] A calculation module 60, configured to calculate a Hadamard product of the first target image and the first eigenvector to obtain a first eigenimage, and to calculate a Hadamard product of the second target image and the second eigenvector to obtain a second eigenimage;
[0115] The second input module 70 is used to input the first feature image and the second feature image into a preset feature extraction model to obtain a target blood vessel region image.
[0116] In one embodiment, the second input module 70 includes:
[0117] A collection submodule, used for collecting the third characteristic image under normal light source;
[0118] An input submodule, used to input the first feature image and the second feature image into a first submodel Calculate and obtain the first output result of the first sub-model; and input the second feature image into the second sub-model Calculate and obtain the second output result; where g θ represents the first output result of the first sub-model, represents the second output result of the second sub-model, i=1 or 2; r1 represents the first feature image, r2 represents the second feature image, r3 represents the third feature image,
[0119] Correction submodule for The first output result and the second output result are corrected to make the first output result and the second output result consistent, thereby obtaining a corrected first output result, wherein the first output result is a target blood vessel region image; It means taking the minimum value of θ under the premise of satisfying the above formula and The maximum value of O G,D is an intermediate value.
[0120] In one embodiment, the acquisition module 10 includes:
[0121] A calling submodule is used to call a preset hyperspectral camera and place the target to be detected under a preset first light environment;
[0122] A division submodule, used to divide the reflected light of the target to be detected under a preset light environment into a first light source and a second light source by using a preset light splitting device;
[0123] A first switching submodule, configured to switch a first light source so that a hyperspectral camera in the hyperspectral camera acquires the first blood vessel image;
[0124] The second switching submodule is used to switch the second light source so that the hyperspectral camera in the hyperspectral camera acquires the second blood vessel image.
[0125] In one embodiment, the feature extraction network includes: an input layer, a hidden layer and an output layer; the first input module 20 includes:
[0126] A blood vessel image input submodule, used for inputting the first blood vessel image and the second blood vessel image into the input layer of the corresponding feature extraction network respectively;
[0127] a processing submodule, configured to perform nonlinear processing on the first blood vessel image and the second blood vessel image inputted by the input layer by using an activation function through a hidden layer to obtain a fitting result;
[0128] The output submodule is used to output the fitting result through an output layer, and output the first feature vector and the second feature vector corresponding to the first blood vessel image and the second blood vessel image.
[0129] In one embodiment, the endoscope-based vascular image acquisition device further includes:
[0130] An extraction module, used to extract the type and geometric information of each feature in the first feature image and the second feature image by a preset method;
[0131] An information input module is used to obtain the type and geometric information of each feature and input it into a preset support vector machine to obtain blood vessel features;
[0132] A feature input module, used to input the blood vessel features into a pre-trained classifier to obtain classification and semantic annotation of the blood vessel features;
[0133] The adding module is used to add the classification and semantic annotation of the blood vessel features to the target blood vessel region image to obtain a labeled target blood vessel image.
[0134] The beneficial effects of the present invention are as follows: Based on the acquisition of the first vascular image and the second vascular image under two light sources, by processing them, automating the image processing and analysis, the user can save a lot of time and energy, and avoid the subjectivity and tediousness of manual assisted identification. This method can improve the efficiency and consistency of identifying vascular images, and provide users with a more accurate basis for diagnosis and treatment decisions. Such an image processing method can provide more accurate vascular information, helping users to better observe and evaluate the morphology and characteristics of blood vessels to obtain target vascular images, and solve the problem that the current recognition of endoscopic vascular images is not accurate enough, resulting in users spending a lot of time on auxiliary recognition.
[0135] Reference Figure 3 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store various vascular images, etc. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the endoscopic-based vascular image acquisition method described in any of the above embodiments can be implemented.
[0136] Those skilled in the art will understand that Figure 3 The structure shown in is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied.
[0137] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the endoscope-based vascular image acquisition method described in any of the above embodiments can be implemented.
[0138] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0139] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0140] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0141] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0142] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of the claims of the present invention.
Claims
1. A method for acquiring vascular images based on an endoscope, It is characterized in that include: Acquire a first blood vessel image through an endoscope under a first light source condition, and acquire a second blood vessel image through an endoscope under a second light source condition; wherein the first light source is an RGB (0, 255, 0) light source, and the second light source is an RGB (0, 0, 255) light source; Inputting the first blood vessel image and the second blood vessel image into a preset feature extraction network respectively to obtain a first feature vector and a second feature vector respectively; The first eigenvector and the second eigenvector are respectively converted into a first grayscale image and a second grayscale image by a preset grayscale method, and a first pixel average value and a second pixel average value of the first grayscale image and the second grayscale image are calculated according to a formula; wherein H represents the height of the grayscale image, W represents the width of the grayscale image, and represents the pixel value at a position where the width is x and the height is y; Preprocessing the first grayscale image and the second grayscale image according to a formula to obtain a first preprocessed image and a second preprocessed image; Performing morphological corrosion on the first preprocessed image and the second preprocessed image, and bridging discontinuous parts of the first preprocessed image and the second preprocessed image by a morphological dilation method, so as to obtain a first target image and a second target image; Calculating the Hadamard product of the first target image and the first eigenvector to obtain a first eigenimage, and calculating the Hadamard product of the second target image and the second eigenvector to obtain a second eigenimage; Inputting the first feature image and the second feature image into a preset feature extraction model to obtain a target blood vessel region image; The steps of acquiring a first blood vessel image through an endoscope under a first light source condition, and acquiring a second blood vessel image through an endoscope under a second light source condition, include: Call the preset hyperspectral camera and place the target to be detected under the preset first light environment; Using a preset light splitting device, the reflected light of the target to be detected under a preset light environment is divided into a first light source and a second light source; Switching the first light source to enable the hyperspectral camera in the hyperspectral camera to acquire the first blood vessel image; Switching the second light source to enable the hyperspectral camera in the hyperspectral camera to acquire the second blood vessel image; The step of inputting the first feature image and the second feature image into a preset feature extraction model to obtain a target blood vessel region image comprises: Collecting a third characteristic image under normal light source; The first feature image and the second feature image are input into the first sub-model for calculation to obtain the first output result of the first sub-model; and the second feature image is input into the second sub-model for calculation to obtain the second output result; wherein, represents the first output result of the first sub-model, represents the second output result of the second sub-model, i=1 or 2; represents the first feature image, represents the second feature image, represents the third feature image,,; The first output result and the second output result are corrected according to the formula to make the first output result and the second output result consistent, thereby obtaining a corrected first output result, wherein the first output result is a target blood vessel region image; wherein represents the minimum value and the maximum value of taken under the premise of satisfying the above formula, is an intermediate value; The feature extraction network includes: an input layer, a hidden layer and an output layer; the step of inputting the first blood vessel image and the second blood vessel image into a preset feature extraction network respectively to obtain a first feature vector and a second feature vector respectively includes: inputting the first blood vessel image and the second blood vessel image into the input layer of the corresponding feature extraction network respectively; Performing nonlinear processing on the first blood vessel image and the second blood vessel image inputted by the input layer by using an activation function through a hidden layer to obtain a fitting result; Outputting the fitting result through an output layer, and outputting the first feature vector and the second feature vector corresponding to the first blood vessel image and the second blood vessel image; After the step of inputting the first feature image and the second feature image into a preset feature extraction model to obtain a target blood vessel region image, the method further includes: Extracting the type and geometric information of each feature in the first feature image and the second feature image by a preset method; The type and geometric information of each feature is obtained and input into a preset support vector machine to obtain the blood vessel features; Inputting the blood vessel features into a pre-trained classifier to obtain classification and semantic annotation of the blood vessel features; The classification and semantic annotation of the blood vessel features are added to the target blood vessel region image to obtain a labeled target blood vessel image.
2. A blood vessel image acquisition device based on an endoscope, It is characterized in that include: An acquisition module, used to acquire a first blood vessel image through an endoscope under a first light source condition, and to acquire a second blood vessel image through an endoscope under a second light source condition; wherein the first light source is an RGB (0, 255, 0) light source, and the second light source is an RGB (0, 0, 255) light source; A first input module, used to input the first blood vessel image and the second blood vessel image into a preset feature extraction network, respectively, to obtain a first feature vector and a second feature vector, respectively; a conversion module, used to convert the first eigenvector and the second eigenvector into a first grayscale image and a second grayscale image respectively by a preset grayscale method, and calculate a first pixel average value and a second pixel average value of the first grayscale image and the second grayscale image according to a formula; wherein H represents the height of the grayscale image, W represents the width of the grayscale image, and represents the pixel value at a position where the width is x and the height is y; A preprocessing module, used for preprocessing the first grayscale image and the second grayscale image according to a formula to obtain a first preprocessed image and a second preprocessed image; A morphological erosion module, configured to perform morphological erosion on the first preprocessed image and the second preprocessed image, and bridge discontinuous parts of the first preprocessed image and the second preprocessed image by a morphological dilation method to obtain a first target image and a second target image; a calculation module, configured to calculate a Hadamard product of the first target image and the first eigenvector to obtain a first eigenimage, and to calculate a Hadamard product of the second target image and the second eigenvector to obtain a second eigenimage; A second input module, used for inputting the first feature image and the second feature image into a preset feature extraction model to obtain a target blood vessel region image; The acquisition module comprises: A calling submodule is used to call a preset hyperspectral camera and place the target to be detected under a preset first light environment; A division submodule, used to divide the reflected light of the target to be detected under a preset light environment into a first light source and a second light source by using a preset light splitting device; A first switching submodule, configured to switch a first light source so that a hyperspectral camera in the hyperspectral camera acquires the first blood vessel image; a second switching submodule, configured to switch a second light source so that the hyperspectral camera in the hyperspectral camera acquires the second blood vessel image; The second input module comprises: A collection submodule, used for collecting the third characteristic image under normal light source; An input submodule, used for inputting the first feature image and the second feature image into a first submodel for calculation to obtain a first output result of the first submodel; and inputting the second feature image into a second submodel for calculation to obtain a second output result; wherein, represents the first output result of the first submodel, represents the second output result of the second submodel, i=1 or 2; represents the first feature image, represents the second feature image, represents the third feature image,,; a correction submodule, configured to correct the first output result and the second output result according to a formula so that the first output result and the second output result are consistent, thereby obtaining a corrected first output result, wherein the first output result is a target blood vessel region image; wherein the minimum value and the maximum value of taken on the premise of satisfying the above formula are an intermediate value; The feature extraction network includes: an input layer, a hidden layer and an output layer; the first input module includes: A blood vessel image input submodule, used for inputting the first blood vessel image and the second blood vessel image into the input layer of the corresponding feature extraction network respectively; a processing submodule, configured to perform nonlinear processing on the first blood vessel image and the second blood vessel image inputted by the input layer by using an activation function through a hidden layer to obtain a fitting result; an output submodule, configured to output the fitting result through an output layer, and output a first eigenvector and a second eigenvector corresponding to the first vascular image and the second vascular image; The endoscope-based blood vessel image acquisition device further includes: An extraction module, used to extract the type and geometric information of each feature in the first feature image and the second feature image by a preset method; An information input module is used to obtain the type and geometric information of each feature and input it into a preset support vector machine to obtain blood vessel features; A feature input module, used to input the blood vessel features into a pre-trained classifier to obtain classification and semantic annotation of the blood vessel features; The adding module is used to add the classification and semantic annotation of the blood vessel features to the target blood vessel region image to obtain a labeled target blood vessel image.
