A predictive model-based method, device, and system for thymoma detection and classification.
By analyzing the grayscale values and coordinate relationships in medical images and combining them with a prediction model, the accuracy problem of thymoma detection and classification in existing technologies has been solved. This has enabled feature extraction and accurate classification of thymoma, reducing misjudgments.
Patent Information
- Application Number
- CN202610445937.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-07
- Publication Date
- 2026-06-30
AI Technical Summary
In existing technologies, thymoma detection and classification methods cannot perform detailed and accurate verification and classification of the prediction results of the prediction model, which increases the workload of doctors.
By analyzing the gray value differences and coordinate relationships between lesion pixels and adjacent pixels in medical images, gray value deviation intervals and angle intervals are constructed. Combined with a prediction model, the images to be identified are analyzed to determine the regions of true thymoma and pseudo thymoma, and to analyze the adhesion type between them and the tissue region.
It enables feature extraction and accurate classification for thymoma detection, reducing misjudgments and improving detection accuracy and efficiency.
Smart Images

Figure CN122313148A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of thymoma detection and classification technology, specifically a thymoma detection and classification method, device, and system based on a prediction model. Background Technology
[0002] Thymoma is a mediastinal tumor originating from thymic epithelial cells or lymphocytes. Clinical symptoms often include chest pain, chest tightness, cough, and chest discomfort. Some cases are complicated by syndromes such as myasthenia gravis or simple erythrocyte aplasia. Small thymomas are often asymptomatic and are often found as mediastinal space-occupying shadows on imaging examinations. As the tumor grows, it can cause superior vena cava obstruction. In the current technology, most methods for the detection and classification of thymoma are achieved through prediction models. However, since different prediction models have different prediction accuracies, using a prediction model with low prediction accuracy will increase the number of errors and further increase the workload of doctors. At the same time, the current technology cannot perform detailed and accurate verification and classification of the prediction results of the prediction model. Therefore, this invention proposes a method, device, and system for thymoma detection and classification based on a predictive model. Summary of the Invention
[0003] The purpose of this invention is to propose a method, device, and system for the detection and classification of thymoma based on a prediction model, so as to solve the problem mentioned in the background art that the prediction results of the prediction model cannot be verified and classified in detail and accurately.
[0004] The objective of this invention can be achieved through the following technical solutions: The first aspect is a thymoma detection and classification method based on a prediction model, which includes the following steps: Step S1: Analyze the gray value differences between different pixels in the medical image based on the gray value, and obtain the reference gray value deviation range between the lesion pixel and the adjacent pixel. Step S2: Analyze the positional relationship between the lesion pixels and the image coordinate system based on the coordinates of different pixels, and obtain the angle range between the center of the thymoma region and the image coordinate system. Step S3: Analyze the undetermined thymoma region in the image to be identified based on the reference gray-scale deviation range and the included angle range to obtain the true thymoma region and the false thymoma region. Step S4: Analyze the adhesion type between the true thymoma region and the tissue region. The analysis shows that the adhesion type of the true thymoma region is either a non-adhesive thymoma region or an adherent thymoma region. Step S5: Output the classification results of the image to be identified based on different adhesion types.
[0005] Furthermore, the analysis process in step S1 includes the following sub-steps: Step S101: Obtain multiple medical images of thymoma, wherein each medical image contains a marked area of thymoma. Step S102: Edge detection technology is used to extract the edge of the marked area to obtain the edge contour of the thymoma, and the area enclosed by the edge contour is recorded as the thymoma region. Step S103: The pixels within the thymoma region are recorded as lesion pixels, the gray values corresponding to the lesion pixels are recorded as lesion gray values, the region composed of non-lesion pixels with gray values not equal to zero in the medical image is recorded as the normal region, the pixels adjacent to the lesion pixels in the normal region are recorded as adjacent pixels, and the gray values of the adjacent pixels are recorded as normal gray values. Step S104: Subtract the normal gray value of the corresponding adjacent pixel from the gray value of the lesion pixel and take the absolute value to obtain the edge gray value deviation between different lesion pixels and their corresponding adjacent pixels.
[0006] Furthermore, the analysis process in step S1 also includes the following sub-steps: Step S105: Sum the edge grayscale deviation values between different lesion pixels and their corresponding adjacent pixels, and take the average value to obtain the average edge grayscale deviation value. Then, calculate the standard deviation of the edge grayscale deviation values between the lesion pixels and their adjacent pixels using the standard deviation formula. Step S106: Subtract the standard deviation from the average edge grayscale deviation value to obtain the endpoint value. Add the average edge grayscale deviation value to the standard deviation to obtain the endpoint value. Construct the edge grayscale deviation interval between the lesion pixel and the adjacent pixel with the endpoint value as the left endpoint and the endpoint value as the right endpoint. In this way, perform the same analysis on the medical images of different thymomas to obtain multiple edge grayscale deviation intervals. Step S107: Traverse and compare the left endpoint values of different edge grayscale deviation intervals to obtain the minimum value of the left endpoint value; traverse and compare the right endpoint values of different edge grayscale deviation intervals to obtain the maximum value of the right endpoint value; take the minimum value of the left endpoint value as the left endpoint and the maximum value of the right endpoint value as the right endpoint to construct the reference grayscale deviation interval between the lesion pixel and the adjacent pixel.
[0007] Furthermore, the analysis process in step S2 includes the following sub-steps: Step S201: Using the center of the medical image as the origin of the coordinate system, a straight line passing through the origin and parallel to the length direction of the medical image is used as the horizontal axis, and a straight line passing through the origin and parallel to the width direction of the medical image is used as the vertical axis. The image coordinate system is constructed using the origin, the horizontal axis, and the vertical axis. Step S202: Place the medical image in the image coordinate system, count the number of pixels between the lesion pixel and the horizontal axis and use it as the vertical coordinate of the lesion pixel, count the number of pixels between the lesion pixel and the vertical axis and use it as the horizontal coordinate of the lesion pixel, and obtain the lesion coordinates of different lesion pixels based on the horizontal and vertical coordinates. Step S203: Iterate through and compare the ordinates of different lesion pixels to obtain the maximum and minimum values of the ordinates. Subtract the minimum value from the maximum value of the ordinate and divide by two to obtain the first value. Add the minimum value of the ordinate to the first value to obtain the second value. Record the second value as the center ordinate of the thymoma region. Step S204: Iterate through and compare the x-coordinates of different lesion pixels to obtain the maximum and minimum x-coordinates. Subtract the minimum x-coordinate from the maximum x-coordinate and divide by two to obtain the third value. Add the minimum x-coordinate to the third value to obtain the fourth value. Record the fourth value as the center x-coordinate of the thymoma region.
[0008] Furthermore, the analysis process in step S2 also includes the following sub-steps: Step S205: Construct the central coordinates of the thymoma region based on the central abscissa and central ordinate; Step S206: The pixel corresponding to the center coordinate of the thymoma region is recorded as the center of the thymoma region. The center of the thymoma region is connected to the origin to obtain a feature line segment. The slope of the feature line segment is obtained by dividing the ordinate of the center coordinate by the abscissa. The arctangent of the slope of the feature line segment is obtained to obtain the horizontal axis angle between the center of the thymoma and the image coordinate system. By analogy, the same analysis is performed on medical images of different thymomas to obtain the horizontal axis angle between the center of different thymoma regions and the image coordinate system. Step S207: Iterate and compare the horizontal angle between the center of different thymoma regions and the image coordinate system to obtain the maximum and minimum values of the horizontal angle. Then, use the minimum value of the horizontal angle as the left endpoint and the maximum value of the horizontal angle as the right endpoint to construct the angle interval between the center of the thymoma region and the image coordinate system.
[0009] Furthermore, the analysis process in step S3 includes the following sub-steps: Step S301: Acquire the patient's medical images and record them as images to be identified. Use a prediction model to predict the images to be identified and obtain the undetermined thymoma region within the images to be identified. Step S302: Repeat steps S201-S206 to calculate the angle between the center of the undetermined thymoma region and the image coordinate system. Step S303: Compare the angle between the center of the undetermined thymoma region and the image coordinate system and the angle range; If the angle between the center of the undetermined thymoma region and the horizontal axis of the image coordinate system does not fall within the angle interval, the corresponding undetermined thymoma region is recorded as a pseudothymoma region. If the angle between the center of the undetermined thymoma region and the horizontal axis of the image coordinate system is within the angle range, proceed to step S304. Step S304: Edge extraction is performed on the thymoma region to be determined using edge detection technology. The edge of the thymoma to be determined is extracted, and the pixel point where the edge of the thymoma to be determined is recorded as the edge pixel point of the thymoma to be determined. The gray value corresponding to the edge pixel point is recorded as the edge gray value. Step S305: Subtract the gray value of the corresponding adjacent pixel from the edge gray value and take the absolute value to obtain the gray value deviation between the edge pixel and the adjacent pixel, and compare the gray value deviation between the edge pixel and the adjacent pixel with the reference gray value deviation range. If there is one and only one edge pixel whose grayscale deviation value between it and its adjacent pixel is within the reference grayscale deviation range, then the corresponding undetermined thymoma region is recorded as a pseudothymoma region. If the grayscale deviation values between multiple edge pixels and their adjacent pixels all fall within the reference grayscale deviation range, then the corresponding undetermined thymoma region is recorded as the true thymoma region.
[0010] Further, step S301 includes the following sub-steps: Step S3011: Collect medical images of thymomas from patients of different ages, genders, disease stages, disease characteristics, and tumor types. Step S3012: Then, the thymoma medical images of patients with the same age group, gender, disease cycle, disease nature and tumor type are summarized into the dataset, all datasets are summarized into the database, and the corresponding database is recorded as the prediction model of thymoma medical images. Step S3013: When the image to be identified is input into the prediction model, the tumor type, disease nature, disease cycle, gender and age group are used as the judgment elements in the following order. Step S3014: Compare the first determination elements of different thymoma medical images in the prediction model with the first determination elements of the image to be identified. If any thymoma medical image in the prediction model has the same first determination element as the first determination element of the image to be identified, then the corresponding thymoma medical image is recorded as the initial thymoma image. If the first determination factor of all thymoma medical images in the prediction model is different from the first determination factor of the image to be identified, no operation will be performed. Step S3015: Select thymoma medical images from the initial thymoma images whose second, third, fourth, and fifth determination elements are the same as the corresponding determination elements in the images to be identified, and record them as selected thymoma images. If there are no thymoma medical images in the initial thymoma images whose second, third, fourth, and fifth determination elements are the same as the corresponding determination elements in the image to be identified, then thymoma medical images whose second, third, and fourth determination elements are the same as the corresponding determination elements in the image to be identified are selected from the initial thymoma images and recorded as selected thymoma images. If there are no thymoma medical images in the initial thymoma images whose second, third, and fourth determination elements are the same as the corresponding determination elements in the image to be identified, then thymoma medical images whose second and third determination elements are the same as the corresponding determination elements in the image to be identified are selected from the initial thymoma images and recorded as selected thymoma images. If there are no thymoma medical images in the initial thymoma images whose second and third criteria are the same as the corresponding criteria in the image to be identified, then thymoma medical images whose second criteria are the same as the corresponding criteria in the image to be identified are selected from the initial thymoma images and recorded as selected thymoma images. If there is no thymoma medical image in the initial thymoma image that has the same second determination element as the corresponding determination element in the image to be identified, then the initial thymoma image is recorded as the screened thymoma image. Step S3016: Record the thymoma region in the screened thymoma images as the undetermined thymoma region in the image to be identified.
[0011] Furthermore, the analysis process in step S4 includes the following sub-steps: Step S401: Pixels within the true thymoma region are recorded as tumor pixels, and the region consisting of non-tumor pixels with gray values not equal to zero in the image to be identified is recorded as the tissue region, and pixels within the tissue region are recorded as tissue pixels. Step S402: Using any edge pixel as the center of the window, construct a judgment window of a fixed size, count the number of non-tumor pixels and the number of tissue pixels in the judgment window, and divide the number of tissue pixels by the number of non-tumor pixels to obtain the proportion of tissue pixels in the judgment window. Step S403: Compare the proportion of tissue pixels within the judgment window with the standard threshold. If the proportion of tissue pixels within the determination window is greater than or equal to the standard proportion threshold, then the corresponding edge pixels are recorded as adhesion pixels within the true thymoma region. If the proportion of tissue pixels within the determination window is less than the standard proportion threshold, the corresponding edge pixels are recorded as non-adhesive pixels within the true thymoma region. Similarly, different edge pixels within the true thymoma region are determined to be either adhered or non-adhesive pixels. Step S405: If there are multiple adherent pixels in the true thymoma region, the adhesion type of the corresponding true thymoma region is recorded as the adherent thymoma region. If there is one and only one adherent pixel within the true thymoma region, then the adhesion type of the corresponding true thymoma region is recorded as a non-adhesive thymoma region.
[0012] Secondly, a thymoma detection and classification device based on a prediction model includes a data acquisition module, a grayscale analysis module, an angle analysis module, a lesion judgment module, and a lesion classification module. The data acquisition module is used to acquire the gray values of different pixels in the medical image and send them to the gray value analysis module; the gray value analysis module is used to analyze the gray value differences between different pixels in the medical image based on the gray values, analyze and obtain the reference gray value deviation range between the lesion pixel and the adjacent pixel, and send the reference gray value deviation range to the lesion judgment module. The data acquisition module is also used to acquire the coordinates of different pixels and send them to the angle analysis module; the angle analysis module is used to analyze the positional relationship between the lesion pixels and the image coordinate system based on the coordinates of different pixels, analyze the angle range between the center of the thymoma region and the image coordinate system, and send the angle range to the lesion judgment module. The lesion judgment module is used to analyze the undetermined thymoma region in the image to be identified based on the reference gray-scale deviation range and the included angle range, to obtain the true thymoma region and the false thymoma region, and to send the true thymoma region to the lesion classification module; the lesion classification module is used to analyze the adhesion type between the true thymoma region and the tissue region, and to determine whether the adhesion type of the true thymoma region is a non-adhesive thymoma region or an adherent thymoma region.
[0013] Thirdly, a thymoma detection and classification system based on a prediction model, the system comprising: A memory that stores a computer program; A processor, communicatively connected to the memory, implements the method described in any one of claims 1-8 when the computer program is executed by the processor.
[0014] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: 1. This invention first analyzes existing medical images of thymoma to obtain the grayscale deviation range between the lesion pixel and the adjacent pixel, and at the same time obtains the angle range between the center of the thymoma region and the image coordinate system. This invention realizes the feature extraction of thymoma in existing medical images. 2. The present invention also constructs a prediction model and uses the prediction model to predict the thymoma region in the image to be identified, thereby predicting the undetermined thymoma region in the image to be identified. At the same time, the gray-scale deviation range and the included angle range are used to judge the undetermined thymoma region in the image to be identified, thereby determining whether it is a true thymoma region or a false thymoma region. Finally, the adhesion type between the true thymoma region and the tissue region is analyzed. Attached Figure Description
[0015] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings.
[0016] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram of adjacent pixels in this invention; Figure 3 This is a schematic diagram of the included angle of the horizontal axis in this invention; Figure 4 This is a schematic diagram of the determination window in this invention; Figure 5 This is a block diagram of the overall device of the present invention; Figure 6 This is a schematic diagram of the thymoma detection and classification system of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Example 1: Please refer to Figures 1-4 As shown, the technical solution provided by this invention is: a thymoma detection and classification method based on a prediction model. This method first analyzes existing medical images of thymomas to obtain the gray-level deviation range between lesion pixels and adjacent pixels, and simultaneously obtains the angle range between the center of the thymoma region and the image coordinate system. Then, it uses the gray-level deviation range and the angle range to determine the undetermined thymoma region in the image to be identified, thus determining whether it is a true thymoma region or a false thymoma region. Finally, it analyzes the adhesion type between the true thymoma region and the tissue region. The method includes the following steps: Step S1: Analyze the gray value differences between different pixels in the medical image based on the gray value, and obtain the reference gray value deviation range between the lesion pixel and the adjacent pixel. In this embodiment, the analysis process in step S1 includes the following sub-steps: Step S101: Obtain multiple medical images of thymoma, wherein each medical image contains a marked area of thymoma. In this embodiment, the medical image of the thymoma is obtained by manually marking the area where the thymoma is located in the medical image; Step S102: Edge detection technology is used to extract the edge of the marked area to obtain the edge contour of the thymoma, and the area enclosed by the edge contour is recorded as the thymoma region. For step S103, please refer to [link / reference]. Figure 2 As shown, pixels within the thymoma region are denoted as lesion pixels, gray values corresponding to lesion pixels are denoted as lesion gray values, regions composed of non-lesion pixels with non-zero gray values in medical images are denoted as normal regions, pixels adjacent to lesion pixels within normal regions are denoted as adjacent pixels, and gray values of adjacent pixels are denoted as normal gray values. Step S104: Subtract the normal gray value of the corresponding adjacent pixel from the gray value of the lesion pixel and take the absolute value to obtain the edge gray value deviation between different lesion pixels and their corresponding adjacent pixels. Step S105: Sum the edge grayscale deviation values between different lesion pixels and their corresponding adjacent pixels, and take the average value to obtain the average edge grayscale deviation value. Then, calculate the standard deviation of the edge grayscale deviation values between the lesion pixels and their adjacent pixels using the standard deviation formula. Step S106: Subtract the standard deviation from the average edge grayscale deviation value to obtain the endpoint value. Add the average edge grayscale deviation value to the standard deviation to obtain the endpoint value. Construct the edge grayscale deviation interval between the lesion pixel and the adjacent pixel with the endpoint value as the left endpoint and the endpoint value as the right endpoint. In this way, perform the same analysis on the medical images of different thymomas to obtain multiple edge grayscale deviation intervals. Step S107: Traverse and compare the left endpoint values of different edge grayscale deviation intervals to obtain the minimum value of the left endpoint value; traverse and compare the right endpoint values of different edge grayscale deviation intervals to obtain the maximum value of the right endpoint value; take the minimum value of the left endpoint value as the left endpoint and the maximum value of the right endpoint value as the right endpoint to construct the reference grayscale deviation interval between the lesion pixel and the adjacent pixel.
[0019] Step S2: Analyze the positional relationship between the lesion pixels and the image coordinate system based on the coordinates of different pixels, and obtain the angle range between the center of the thymoma region and the image coordinate system. In this embodiment, the analysis process in step S2 includes the following sub-steps: Step S201: Using the center of the medical image as the origin of the coordinate system, a straight line passing through the origin and parallel to the length direction of the medical image is used as the horizontal axis, and a straight line passing through the origin and parallel to the width direction of the medical image is used as the vertical axis. The image coordinate system is constructed using the origin, the horizontal axis, and the vertical axis. In the specific implementation process, medical images are rectangular images. The intersection of the two diagonals of the medical image is the origin of the image coordinate system. It should be explained that medical images obtained from scanning the same organ for different patients have the same imaging standard. There is a fixed point on the corresponding organ in the medical image that must coincide with the origin of the coordinate system to ensure that the organ is located at the center of the medical image. Step S202: Place the medical image in the image coordinate system, count the number of pixels between the lesion pixel and the horizontal axis and use it as the vertical coordinate of the lesion pixel, count the number of pixels between the lesion pixel and the vertical axis and use it as the horizontal coordinate of the lesion pixel, and obtain the lesion coordinates of different lesion pixels based on the horizontal and vertical coordinates. Step S203: Iterate through and compare the ordinates of different lesion pixels to obtain the maximum and minimum values of the ordinates. Subtract the minimum value from the maximum value of the ordinate and divide by two to obtain the first value. Add the minimum value of the ordinate to the first value to obtain the second value. Record the second value as the center ordinate of the thymoma region. Step S204: Iterate through and compare the x-coordinates of different lesion pixels to obtain the maximum and minimum x-coordinates. Subtract the minimum x-coordinate from the maximum x-coordinate and divide by two to obtain the third value. Add the minimum x-coordinate to the third value to obtain the fourth value. Record the fourth value as the center x-coordinate of the thymoma region. Step S205: Construct the central coordinates of the thymoma region based on the central abscissa and central ordinate; For step S206, please refer to... Figure 3 As shown, the pixel point corresponding to the center coordinates of the thymoma region is recorded as the center of the thymoma region. The feature line segment is obtained by connecting the center of the thymoma region with the origin of the coordinate system. The slope of the feature line segment is obtained by dividing the ordinate of the center coordinate by the abscissa. The arctangent of the slope of the feature line segment is used to obtain the horizontal axis angle between the center of the thymoma and the image coordinate system. Similarly, the same analysis is performed on medical images of different thymomas to obtain the horizontal axis angle between the center of different thymoma regions and the image coordinate system. Step S207: Iterate through and compare the horizontal angles between the center of different thymoma regions and the image coordinate system to obtain the maximum and minimum values of the horizontal angles. Then, use the minimum value of the horizontal angle as the left endpoint and the maximum value of the horizontal angle as the right endpoint to construct the angle range between the center of the thymoma region and the image coordinate system. It should be explained that different tumors are located in different parts of the body. Thymoma is a tumor that originates from the epithelial cells of the thymus and its core is located in the anterior mediastinal region of the thoracic cavity. By using the central distance and angle range between different thymomas and the origin of the coordinate system, non-thymoma areas can be initially screened out.
[0020] Step S3: Analyze the undetermined thymoma region in the image to be identified based on the reference gray-scale deviation range and the included angle range to obtain the true thymoma region and the false thymoma region. In this embodiment, the analysis process in step S3 includes the following sub-steps: Step S301: Acquire the patient's medical images and record them as images to be identified. Use a prediction model to predict the images to be identified and obtain the undetermined thymoma region within the images to be identified. In this embodiment, step S301 includes the following sub-steps: Step S3011: Collect medical images of thymomas from patients of different ages, genders, disease stages, disease characteristics, and tumor types. It should be explained that the disease cycle includes early, middle and late stages of thymoma, the tumor type includes thymoma of type A, AB, B1, B2, B3 and C, and the nature of the disease includes benign thymoma and malignant thymoma. Step S3012: Then, the thymoma medical images of patients with the same age group, gender, disease cycle, disease nature and tumor type are summarized into the dataset, all datasets are summarized into the database, and the corresponding database is recorded as the prediction model of thymoma medical images. Step S3013: When the image to be identified is input into the prediction model, the tumor type, disease nature, disease cycle, gender and age group are used as the judgment elements in the following order. Step S3014: Compare the first determination elements of different thymoma medical images in the prediction model with the first determination elements of the image to be identified. If any thymoma medical image in the prediction model has the same first determination element as the first determination element of the image to be identified, then the corresponding thymoma medical image is recorded as the initial thymoma image. If the first determination factor of all thymoma medical images in the prediction model is different from the first determination factor of the image to be identified, no operation will be performed. It should be explained that when the first determination element of all thymoma medical images in the prediction model is different from the first determination element of the image to be identified, it means that there is no corresponding tumor type in the database, and the thymoma in the image to be identified is a new and unknown tumor. Step S3015: Select thymoma medical images from the initial thymoma images whose second, third, fourth, and fifth determination elements are the same as the corresponding determination elements in the images to be identified, and record them as selected thymoma images. If there are no thymoma medical images in the initial thymoma images whose second, third, fourth, and fifth determination elements are the same as the corresponding determination elements in the image to be identified, then thymoma medical images whose second, third, and fourth determination elements are the same as the corresponding determination elements in the image to be identified are selected from the initial thymoma images and recorded as selected thymoma images. If there are no thymoma medical images in the initial thymoma images whose second, third, and fourth determination elements are the same as the corresponding determination elements in the image to be identified, then thymoma medical images whose second and third determination elements are the same as the corresponding determination elements in the image to be identified are selected from the initial thymoma images and recorded as selected thymoma images. If there are no thymoma medical images in the initial thymoma images whose second and third criteria are the same as the corresponding criteria in the image to be identified, then thymoma medical images whose second criteria are the same as the corresponding criteria in the image to be identified are selected from the initial thymoma images and recorded as selected thymoma images. If there is no thymoma medical image in the initial thymoma image that has the same second determination element as the corresponding determination element in the image to be identified, then the initial thymoma image is recorded as the screened thymoma image. Step S3016: Record the thymoma region in the screened thymoma images as the undetermined thymoma region in the image to be identified. It should be explained that due to differences in structural parameters between different devices, there will be errors in the medical images obtained by different devices. Therefore, the thymoma area here is recorded as the undetermined thymoma area. Step S302: Repeat steps S201-S206 to calculate the angle between the center of the undetermined thymoma region and the image coordinate system. Step S303: Compare the angle between the center of the undetermined thymoma region and the image coordinate system and the angle range; If the angle between the center of the undetermined thymoma region and the horizontal axis of the image coordinate system does not fall within the angle interval, the corresponding undetermined thymoma region is recorded as a pseudothymoma region. If the angle between the center of the undetermined thymoma region and the horizontal axis of the image coordinate system is within the angle range, proceed to step S304. It should be explained that when the region of undetermined pseudothymoma is determined to be a pseudothymoma region, it means that the prediction model may mistakenly identify other tumors as thymomas. Step S304: Edge extraction is performed on the thymoma region to be determined using edge detection technology. The edge of the thymoma to be determined is extracted, and the pixel point where the edge of the thymoma to be determined is recorded as the edge pixel point of the thymoma to be determined. The gray value corresponding to the edge pixel point is recorded as the edge gray value. Step S305: Subtract the gray value of the corresponding adjacent pixel from the edge gray value and take the absolute value to obtain the gray value deviation between the edge pixel and the adjacent pixel, and compare the gray value deviation between the edge pixel and the adjacent pixel with the reference gray value deviation range. If there is one and only one edge pixel whose grayscale deviation value between it and its adjacent pixel is within the reference grayscale deviation range, then the corresponding undetermined thymoma region is recorded as a pseudothymoma region. If the grayscale deviation values between multiple edge pixels and their adjacent pixels all fall within the reference grayscale deviation range, then the corresponding undetermined thymoma region is recorded as the true thymoma region.
[0021] Step S4: Analyze the adhesion type between the true thymoma region and the tissue region. The analysis shows that the adhesion type of the true thymoma region is either a non-adhesive thymoma region or an adherent thymoma region. In this embodiment, the analysis process in step S4 includes the following sub-steps: Step S401: Pixels within the true thymoma region are recorded as tumor pixels, and the region consisting of non-tumor pixels with gray values not equal to zero in the image to be identified is recorded as the tissue region, and pixels within the tissue region are recorded as tissue pixels. It should be noted that tumor pixels include all edge pixels, while edge pixels do not include all tumor pixels; For step S402, please refer to... Figure 4 As shown, a fixed-size decision window is constructed with any edge pixel as the center of the window. The number of non-tumor pixels and the number of tissue pixels in the decision window are counted. The proportion of tissue pixels in the decision window is obtained by dividing the number of tissue pixels by the number of non-tumor pixels. In this embodiment, the fixed size of the determination window is 3×3. Please refer to [link / reference]. Figure 4 As shown, the number of non-tumor pixels in the determination window is 7, the number of non-tumor pixels with a gray value of zero is 3, the number of tissue pixels is 4, and the proportion of tissue pixels is 4 / 7. Step S403: Compare the proportion of tissue pixels within the judgment window with the standard threshold. If the proportion of tissue pixels within the determination window is greater than or equal to the standard proportion threshold, then the corresponding edge pixels are recorded as adhesion pixels within the true thymoma region. If the proportion of tissue pixels within the determination window is less than the standard proportion threshold, the corresponding edge pixels are recorded as non-adhesive pixels within the true thymoma region. Similarly, different edge pixels within the true thymoma region are determined to be either adhered or non-adhesive pixels. In this embodiment, the standard percentage threshold is a fixed value of 50%. Step S405: If there are multiple adherent pixels in the true thymoma region, the adhesion type of the corresponding true thymoma region is recorded as the adherent thymoma region. If there is one and only one adherent pixel within the true thymoma region, then the adhesion type of the corresponding true thymoma region is recorded as a non-adhesive thymoma region. It should be explained that thymomas generally originate from thymic epithelial cells or lymphocytes. When there is only one adhesion pixel in the area of a true thymoma, it is considered that the adhesion pixel is an adhesion between the thymoma and the area of origin, and there is no adhesion to other tissues. When there are multiple adhesion pixels in the area of a true thymoma, it is considered that there is also adhesion between the thymoma and other tissues. Compared with non-adhesive thymomas, adhesive thymomas are more difficult to treat.
[0022] Step S5: Output the classification results of the image to be identified based on different adhesion types; In the specific implementation process, when the adhesion type of the true thymoma area is non-adhesive thymoma area, the corresponding image to be identified is recorded as non-adhesive thymoma image; when the adhesion type of the true thymoma area is adhesive thymoma area, the corresponding image to be identified is recorded as adhesive thymoma image.
[0023] Example 2: Please refer to Figure 5 As shown, based on another concept of the same invention, a thymoma detection and classification device based on a prediction model is also proposed, including a data acquisition module, a grayscale analysis module, an angle analysis module, a lesion judgment module and a lesion classification module; The data acquisition module is used to acquire the gray values of different pixels in the medical image and send them to the gray value analysis module; the gray value analysis module is used to analyze the gray value differences between different pixels in the medical image based on the gray values, analyze and obtain the reference gray value deviation range between the lesion pixel and the adjacent pixel, and send the reference gray value deviation range to the lesion judgment module. The data acquisition module is also used to acquire the coordinates of different pixels and send them to the angle analysis module; the angle analysis module is used to analyze the positional relationship between the lesion pixels and the image coordinate system based on the coordinates of different pixels, analyze the angle range between the center of the thymoma region and the image coordinate system, and send the angle range to the lesion judgment module. The lesion judgment module is used to analyze the undetermined thymoma region in the image to be identified based on the reference gray-scale deviation range and the included angle range, to obtain the true thymoma region and the false thymoma region, and to send the true thymoma region to the lesion classification module; the lesion classification module is used to analyze the adhesion type between the true thymoma region and the tissue region, and to determine whether the adhesion type of the true thymoma region is a non-adhesive thymoma region or an adherent thymoma region.
[0024] Example 3: Figure 6 As shown, this embodiment provides a thymoma detection and classification system based on a prediction model. The thymoma detection and classification system may include a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. The processor can call logical instructions in memory to execute a thymoma detection and classification method based on a prediction model. This method includes: analyzing the grayscale differences between different pixels in a medical image based on grayscale values to obtain a reference grayscale deviation range between the lesion pixel and its adjacent pixels; analyzing the positional relationship between the lesion pixel and the image coordinate system based on the coordinates of different pixels to obtain the angle range between the center of the thymoma region and the image coordinate system; analyzing the undetermined thymoma region in the image to be identified based on the reference grayscale deviation range and the angle range to obtain the true thymoma region and the pseudo-thymoma region; analyzing the adhesion type between the true thymoma region and the tissue region to determine whether the adhesion type of the true thymoma region is a non-adhesive thymoma region or an adherent thymoma region; and outputting the classification result of the image to be identified based on the different adhesion types.
[0025] Furthermore, when the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0026] On the other hand, this application also provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the thymoma detection and classification method based on the prediction model provided by the above methods. The method includes: analyzing the gray value differences between different pixels in a medical image based on gray values to obtain a reference gray value deviation range between the lesion pixel and its adjacent pixels; analyzing the positional relationship between the lesion pixel and the image coordinate system based on the coordinates of different pixels to obtain an angle range between the center of the thymoma region and the image coordinate system; analyzing the undetermined thymoma region in the image to be identified based on the reference gray value deviation range and the angle range to obtain a true thymoma region and a false thymoma region; analyzing the adhesion type between the true thymoma region and the tissue region to obtain whether the adhesion type of the true thymoma region is a non-adhesive thymoma region or an adherent thymoma region; and outputting the classification result of the image to be identified based on different adhesion types.
[0027] Furthermore, this application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, performs the aforementioned thymoma detection and classification methods based on prediction models. The method includes: analyzing the grayscale differences between different pixels in a medical image based on grayscale values to obtain a reference grayscale deviation range between the lesion pixel and its adjacent pixels; analyzing the positional relationship between the lesion pixel and the image coordinate system based on the coordinates of different pixels to obtain an angle range between the center of the thymoma region and the image coordinate system; analyzing the undetermined thymoma region in the image to be identified based on the reference grayscale deviation range and the angle range to obtain a true thymoma region and a false thymoma region; analyzing the adhesion type between the true thymoma region and the tissue region to determine whether the adhesion type of the true thymoma region is a non-adhesive thymoma region or an adherent thymoma region; and outputting the classification result of the image to be identified based on the different adhesion types.
[0028] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0029] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0030] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A thymoma detection and classification method based on a predictive model, characterized in that, The method includes the following steps: Step S1: Analyze the gray value differences between different pixels in the medical image based on the gray value, and obtain the reference gray value deviation range between the lesion pixel and the adjacent pixel. Step S2: Analyze the positional relationship between the lesion pixels and the image coordinate system based on the coordinates of different pixels, and obtain the angle range between the center of the thymoma region and the image coordinate system. Step S3: Analyze the undetermined thymoma region in the image to be identified based on the reference gray-scale deviation range and the included angle range to obtain the true thymoma region and the false thymoma region. Step S4: Analyze the adhesion type between the true thymoma region and the tissue region. The analysis shows that the adhesion type of the true thymoma region is either a non-adhesive thymoma region or an adherent thymoma region. Step S5: Output the classification results of the image to be identified based on different adhesion types.
2. The thymoma detection and classification method based on a prediction model according to claim 1, characterized in that, The analysis process in step S1 includes the following sub-steps: Step S101: Obtain multiple medical images of thymoma, wherein each medical image contains a marked area of thymoma. Step S102: Edge detection technology is used to extract the edge of the marked area to obtain the edge contour of the thymoma, and the area enclosed by the edge contour is recorded as the thymoma region. Step S103: The pixels within the thymoma region are recorded as lesion pixels, the gray values corresponding to the lesion pixels are recorded as lesion gray values, the region composed of non-lesion pixels with gray values not equal to zero in the medical image is recorded as the normal region, the pixels adjacent to the lesion pixels in the normal region are recorded as adjacent pixels, and the gray values of the adjacent pixels are recorded as normal gray values. Step S104: Subtract the normal gray value of the corresponding adjacent pixel from the gray value of the lesion pixel and take the absolute value to obtain the edge gray value deviation between different lesion pixels and their corresponding adjacent pixels.
3. The thymoma detection and classification method based on a prediction model according to claim 2, characterized in that, The analysis process in step S1 also includes the following sub-steps: Step S105: Sum the edge grayscale deviation values between different lesion pixels and their corresponding adjacent pixels, and take the average value to obtain the average edge grayscale deviation value. Then, calculate the standard deviation of the edge grayscale deviation values between the lesion pixels and their adjacent pixels using the standard deviation formula. Step S106: Subtract the standard deviation from the average edge grayscale deviation value to obtain the endpoint value. Add the average edge grayscale deviation value to the standard deviation to obtain the endpoint value. Construct the edge grayscale deviation interval between the lesion pixel and the adjacent pixel with the endpoint value as the left endpoint and the endpoint value as the right endpoint. In this way, perform the same analysis on the medical images of different thymomas to obtain multiple edge grayscale deviation intervals. Step S107: Traverse and compare the left endpoint values of different edge grayscale deviation intervals to obtain the minimum value of the left endpoint value; traverse and compare the right endpoint values of different edge grayscale deviation intervals to obtain the maximum value of the right endpoint value; take the minimum value of the left endpoint value as the left endpoint and the maximum value of the right endpoint value as the right endpoint to construct the reference grayscale deviation interval between the lesion pixel and the adjacent pixel.
4. The thymoma detection and classification method based on a prediction model according to claim 1, characterized in that, The analysis process in step S2 includes the following sub-steps: Step S201: Using the center of the medical image as the origin of the coordinate system, a straight line passing through the origin and parallel to the length direction of the medical image is used as the horizontal axis, and a straight line passing through the origin and parallel to the width direction of the medical image is used as the vertical axis. The image coordinate system is constructed using the origin, the horizontal axis, and the vertical axis. Step S202: Place the medical image in the image coordinate system, count the number of pixels between the lesion pixel and the horizontal axis and use it as the vertical coordinate of the lesion pixel, count the number of pixels between the lesion pixel and the vertical axis and use it as the horizontal coordinate of the lesion pixel, and obtain the lesion coordinates of different lesion pixels based on the horizontal and vertical coordinates. Step S203: Iterate through and compare the ordinates of different lesion pixels to obtain the maximum and minimum values of the ordinates. Subtract the minimum value from the maximum value of the ordinate and divide by two to obtain the first value. Add the minimum value of the ordinate to the first value to obtain the second value. Record the second value as the center ordinate of the thymoma region. Step S204: Iterate through and compare the x-coordinates of different lesion pixels to obtain the maximum and minimum x-coordinates. Subtract the minimum x-coordinate from the maximum x-coordinate and divide by two to obtain the third value. Add the minimum x-coordinate to the third value to obtain the fourth value. Record the fourth value as the center x-coordinate of the thymoma region.
5. The thymoma detection and classification method based on a prediction model according to claim 4, characterized in that, The analysis process in step S2 also includes the following sub-steps: Step S205: Construct the central coordinates of the thymoma region based on the central abscissa and central ordinate; Step S206: The pixel corresponding to the center coordinate of the thymoma region is recorded as the center of the thymoma region. The center of the thymoma region is connected to the origin to obtain a feature line segment. The slope of the feature line segment is obtained by dividing the ordinate of the center coordinate by the abscissa. The arctangent of the slope of the feature line segment is obtained to obtain the horizontal axis angle between the center of the thymoma and the image coordinate system. By analogy, the same analysis is performed on medical images of different thymomas to obtain the horizontal axis angle between the center of different thymoma regions and the image coordinate system. Step S207: Iterate and compare the horizontal angle between the center of different thymoma regions and the image coordinate system to obtain the maximum and minimum values of the horizontal angle. Then, use the minimum value of the horizontal angle as the left endpoint and the maximum value of the horizontal angle as the right endpoint to construct the angle interval between the center of the thymoma region and the image coordinate system.
6. The thymoma detection and classification method based on a prediction model according to claim 1, characterized in that, The analysis process in step S3 includes the following sub-steps: Step S301: Acquire the patient's medical images and record them as images to be identified. Use a prediction model to predict the images to be identified and obtain the undetermined thymoma region within the images to be identified. Step S302: Repeat steps S201-S206 to calculate the angle between the center of the undetermined thymoma region and the image coordinate system. Step S303: Compare the angle between the center of the undetermined thymoma region and the image coordinate system and the angle range; If the angle between the center of the undetermined thymoma region and the horizontal axis of the image coordinate system does not fall within the angle interval, the corresponding undetermined thymoma region is recorded as a pseudothymoma region. If the angle between the center of the undetermined thymoma region and the horizontal axis of the image coordinate system is within the angle range, proceed to step S304. Step S304: Edge extraction is performed on the thymoma region to be determined using edge detection technology. The edge of the thymoma to be determined is extracted, and the pixel point where the edge of the thymoma to be determined is recorded as the edge pixel point of the thymoma to be determined. The gray value corresponding to the edge pixel point is recorded as the edge gray value. Step S305: Subtract the gray value of the corresponding adjacent pixel from the edge gray value and take the absolute value to obtain the gray value deviation between the edge pixel and the adjacent pixel, and compare the gray value deviation between the edge pixel and the adjacent pixel with the reference gray value deviation range. If there is one and only one edge pixel whose grayscale deviation value between it and its adjacent pixel is within the reference grayscale deviation range, then the corresponding undetermined thymoma region is recorded as a pseudothymoma region. If the grayscale deviation values between multiple edge pixels and their adjacent pixels all fall within the reference grayscale deviation range, then the corresponding undetermined thymoma region is recorded as the true thymoma region.
7. The thymoma detection and classification method based on a prediction model according to claim 6, characterized in that, Step S301 includes the following sub-steps: Step S3011: Collect medical images of thymomas from patients of different ages, genders, disease stages, disease characteristics, and tumor types. Step S3012: Then, the thymoma medical images of patients with the same age group, gender, disease cycle, disease nature and tumor type are summarized into the dataset, all datasets are summarized into the database, and the corresponding database is recorded as the prediction model of thymoma medical images. Step S3013: When the image to be identified is input into the prediction model, the tumor type, disease nature, disease cycle, gender and age group are used as the judgment elements in the following order. Step S3014: Compare the first determination elements of different thymoma medical images in the prediction model with the first determination elements of the image to be identified. If any thymoma medical image in the prediction model has the same first determination element as the first determination element of the image to be identified, then the corresponding thymoma medical image is recorded as the initial thymoma image. If the first determination factor of all thymoma medical images in the prediction model is different from the first determination factor of the image to be identified, no operation will be performed. Step S3015: Select thymoma medical images from the initial thymoma images whose second, third, fourth, and fifth determination elements are the same as the corresponding determination elements in the images to be identified, and record them as selected thymoma images. If there are no thymoma medical images in the initial thymoma images whose second, third, fourth, and fifth determination elements are the same as the corresponding determination elements in the image to be identified, then thymoma medical images whose second, third, and fourth determination elements are the same as the corresponding determination elements in the image to be identified are selected from the initial thymoma images and recorded as selected thymoma images. If there are no thymoma medical images in the initial thymoma images whose second, third, and fourth determination elements are the same as the corresponding determination elements in the image to be identified, then thymoma medical images whose second and third determination elements are the same as the corresponding determination elements in the image to be identified are selected from the initial thymoma images and recorded as selected thymoma images. If there are no thymoma medical images in the initial thymoma images whose second and third criteria are the same as the corresponding criteria in the image to be identified, then thymoma medical images whose second criteria are the same as the corresponding criteria in the image to be identified are selected from the initial thymoma images and recorded as selected thymoma images. If there is no thymoma medical image in the initial thymoma image that has the same second determination element as the corresponding determination element in the image to be identified, then the initial thymoma image is recorded as the screened thymoma image. Step S3016: Record the thymoma region in the screened thymoma images as the undetermined thymoma region in the image to be identified.
8. The thymoma detection and classification method based on a prediction model according to claim 1, characterized in that, The analysis process in step S4 includes the following sub-steps: Step S401: Pixels within the true thymoma region are recorded as tumor pixels, and the region consisting of non-tumor pixels with gray values not equal to zero in the image to be identified is recorded as the tissue region, and pixels within the tissue region are recorded as tissue pixels. Step S402: Using any edge pixel as the center of the window, construct a judgment window of a fixed size, count the number of non-tumor pixels and the number of tissue pixels in the judgment window, and divide the number of tissue pixels by the number of non-tumor pixels to obtain the proportion of tissue pixels in the judgment window. Step S403: Compare the proportion of tissue pixels within the judgment window with the standard threshold. If the proportion of tissue pixels within the determination window is greater than or equal to the standard proportion threshold, then the corresponding edge pixels are recorded as adhesion pixels within the true thymoma region. If the proportion of tissue pixels within the determination window is less than the standard proportion threshold, the corresponding edge pixels are recorded as non-adhesive pixels within the true thymoma region. Similarly, different edge pixels within the true thymoma region are determined to be either adhered or non-adhesive pixels. Step S405: If there are multiple adherent pixels in the true thymoma region, the adhesion type of the corresponding true thymoma region is recorded as the adherent thymoma region. If there is one and only one adherent pixel within the true thymoma region, then the adhesion type of the corresponding true thymoma region is recorded as a non-adhesive thymoma region.
9. A thymoma detection and classification device based on a prediction model, characterized in that, The thymoma detection and classification method based on the prediction model according to any one of claims 1-8 includes a data acquisition module, a grayscale analysis module, an angle analysis module, a lesion judgment module, and a lesion classification module; The data acquisition module is used to acquire the gray values of different pixels in the medical image and send them to the gray value analysis module; the gray value analysis module is used to analyze the gray value differences between different pixels in the medical image based on the gray values, analyze and obtain the reference gray value deviation range between the lesion pixel and the adjacent pixel, and send the reference gray value deviation range to the lesion judgment module. The data acquisition module is also used to acquire the coordinates of different pixels and send them to the angle analysis module; the angle analysis module is used to analyze the positional relationship between the lesion pixels and the image coordinate system based on the coordinates of different pixels, analyze the angle range between the center of the thymoma region and the image coordinate system, and send the angle range to the lesion judgment module. The lesion judgment module is used to analyze the undetermined thymoma region in the image to be identified based on the reference gray-scale deviation range and the included angle range, to obtain the true thymoma region and the false thymoma region, and to send the true thymoma region to the lesion classification module. The lesion classification module is used to analyze the adhesion type between the true thymoma area and the tissue area, and the analysis results in the adhesion type of the true thymoma area being either a non-adhesive thymoma area or an adherent thymoma area.
10. A thymoma detection and classification system based on a predictive model, characterized in that, The system includes: A memory that stores a computer program; A processor, communicatively connected to the memory, implements the method described in any one of claims 1-8 when the computer program is executed by the processor.
