Radiotherapy positioning error detection method and system based on portrait segmentation, and storage medium

By using a human face segmentation-based method, radiotherapy positioning deviations are automatically quantified, solving the problems of large positioning errors and low efficiency, and achieving precise radiotherapy positioning adjustments and improved safety.

CN121998998APending Publication Date: 2026-05-08THE AFFILIATED HOSPITAL OF SOUTHWEST MEDICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
THE AFFILIATED HOSPITAL OF SOUTHWEST MEDICAL UNIV
Filing Date
2026-01-28
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing radiotherapy positioning methods rely on manual operation, which makes it difficult to reproduce the initial positioning state, resulting in large errors and low efficiency. This is especially true for breast cancer patients, where positioning reproduction is difficult and increases the patient's radiation dose.

Method used

A human face segmentation-based method is adopted. The target region mask of the reference and the positioning image to be tested is obtained through the human face segmentation model. The centroid pixel offset distance and error area ratio are calculated, the positioning deviation is automatically quantified, and a visual image is provided to assist in adjustment.

Benefits of technology

It significantly improves the accuracy of radiotherapy positioning error detection, reduces the subjective judgment of radiotherapy technicians, and improves radiotherapy safety and work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121998998A_ABST
    Figure CN121998998A_ABST
Patent Text Reader

Abstract

The invention provides a portrait segmentation-based radiotherapy positioning error detection method and system and a storage medium. The method comprises the following steps of: firstly, acquiring a to-be-detected positioning image corresponding to a radiotherapy positioning to be adopted by a radiotherapy patient during secondary radiotherapy and a reference positioning image corresponding to the radiotherapy positioning adopted by the first radiotherapy; obtaining target area masks corresponding to the reference placement image and the to-be-detected placement image by using a portrait segmentation model, and calculating a mass center actual offset distance and an error area ratio based on the target area masks of the reference placement image and the to-be-detected placement image so as to judge whether the radiotherapy placement to be adopted for secondary radiotherapy is qualified or not; therefore, by automatically and accurately segmenting the human body area and combining with the radiotherapy positioning adopted by the first time of radiotherapy, the radiotherapy positioning deviation of the second time of radiotherapy is quantified, and a radiotherapy technician is prevented from subjectively judging the positioning error, so that the detection accuracy of the radiotherapy positioning error is remarkably improved, the radiotherapy technician is accurately assisted in adjusting the radiotherapy positioning, and the radiotherapy positioning accuracy is improved. And the radiotherapy safety is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of precision radiotherapy control technology, and in particular to a method, system and storage medium for detecting radiotherapy positioning errors based on human image segmentation. Background Technology

[0002] Precise positioning is crucial for treatment outcomes during radiotherapy. Existing radiotherapy positioning and CT-guided repositioning methods rely on manual operation and calibration, making it difficult to reproduce the initial positioning during multiple radiotherapy sessions and repositioning, resulting in problems such as large errors and low efficiency.

[0003] With the development of imaging technology, image-guided radiation therapy (IGRT) techniques such as X-rays, CT, and MRI have been introduced into radiotherapy. These techniques allow for the acquisition of anatomical imaging information before and during treatment, which can be compared with the treatment plan to achieve precise positional comparisons. Examples include Electronic Portal Imaging Device (EPID), Cone Beam CT (CBCT), MRgRT (MRgRT), and 4D-CBCT. However, these methods increase the patient's radiation dose, and radiation therapists cannot refer to the imaging information when positioning the patient, especially in cases like breast cancer patients where positional reproduction is difficult.

[0004] Therefore, it is necessary to propose a scheme that can automatically and accurately locate the patient's body area and quantify the radiotherapy positioning deviation, which can not only eliminate the dependence on manual methods, but also reduce the patient's radiation dose. Summary of the Invention

[0005] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a radiotherapy positioning error detection method based on human image segmentation. By automatically and accurately segmenting the human body region and combining it with the radiotherapy positioning used in the first radiotherapy, the radiotherapy positioning deviation in the subsequent radiotherapy is quantified. This avoids the radiotherapy technician's subjective judgment of positioning error, thereby significantly improving the detection accuracy of radiotherapy positioning error and accurately assisting the radiotherapy technician in adjusting the radiotherapy positioning, thus improving the safety of radiotherapy.

[0006] To achieve the above-mentioned objectives, the present invention provides the following technical solution:

[0007] A method for detecting radiotherapy positioning errors based on human face segmentation includes the following steps:

[0008] Acquire the reference positioning image corresponding to the radiotherapy positioning used for the first radiotherapy of the radiotherapy patient, and acquire the image of the positioning to be examined corresponding to the radiotherapy positioning to be used for the second radiotherapy of the same radiotherapy patient;

[0009] The reference positioning image and the positioning image to be tested are respectively input into a preset portrait segmentation model for portrait segmentation to obtain the target region mask corresponding to the reference positioning image and the positioning image to be tested;

[0010] Calculate the centroid pixel offset distance, the number of overlapping pixels, and the number of non-overlapping pixels between the target region masks corresponding to the reference positioning image and the positioning image to be inspected;

[0011] Based on the set camera calibration parameters, the centroid pixel offset distance is calculated as the actual centroid offset distance, and the ratio of the number of non-overlapping pixels to the number of overlapping pixels is calculated to obtain the error area ratio.

[0012] Based on the actual offset distance of the centroid and the error area ratio, it is determined whether the radiotherapy positioning to be used for the next radiotherapy meets the preset conditions. If it does, the proposed radiotherapy positioning is indicated to be qualified; otherwise, the proposed radiotherapy positioning is indicated to be unqualified.

[0013] According to a specific implementation, in the radiotherapy positioning error detection method based on human image segmentation of the present invention, after obtaining the target region masks corresponding to the reference positioning image and the positioning image to be tested, the target region masks corresponding to the reference positioning image and the positioning image to be tested are respectively mapped to different pseudo-colors to obtain pseudo-color images corresponding to the reference positioning image and the positioning image to be tested. Then, the pseudo-color images corresponding to the reference positioning image and the positioning image to be tested are superimposed to obtain a visualization image of the detection result.

[0014] Furthermore, after acquiring the pseudo-color images corresponding to the reference positioning image and the positioning image to be inspected, the transparency of the pseudo-color images corresponding to the reference positioning image and the positioning image to be inspected is increased, and the corresponding pseudo-color images with increased transparency are superimposed on the reference positioning image and the positioning image to be inspected, respectively.

[0015] According to a specific embodiment, in the radiotherapy positioning error detection method based on human image segmentation of the present invention, the method for calculating the centroid pixel offset distance as the actual centroid offset distance is as follows:

[0016]

[0017] Where D represents the actual offset distance of the centroid. Indicates the centroid pixel offset distance. Z represents the camera's focal length, and Z represents the physical distance between the camera and the radiotherapy patient.

[0018] According to a specific implementation, in the radiotherapy positioning error detection method based on human image segmentation of the present invention, the human image segmentation model is configured as follows: a PP-HumanSeg human image segmentation model constructed using a MobileNetV3 backbone network, and multi-scale feature fusion is used to fuse image features, and stochastic gradient descent is used for optimization during training.

[0019] Based on the same inventive concept, the present invention also provides a radiotherapy positioning error detection system based on human image segmentation, which includes:

[0020] The image acquisition module is used to acquire the reference positioning image corresponding to the radiotherapy positioning used for the first radiotherapy of the radiotherapy patient, and to acquire the image of the positioning to be examined corresponding to the radiotherapy positioning to be used for the second radiotherapy of the same radiotherapy patient.

[0021] A portrait segmentation module is used to perform portrait segmentation on the reference positioning image and the positioning image to be inspected, so as to obtain the target region mask corresponding to the reference positioning image and the positioning image to be inspected;

[0022] The error calculation module is used to calculate the centroid pixel offset distance, the number of overlapping pixels, and the number of non-overlapping pixels between the target area masks corresponding to the reference positioning image and the positioning image to be inspected. Based on the set camera calibration parameters, the centroid pixel offset distance is solved into the actual centroid offset distance. The module also calculates the ratio of the number of non-overlapping pixels to the number of overlapping pixels to obtain the error area ratio.

[0023] The error judgment module is used to determine whether the radiotherapy positioning to be used for the next radiotherapy meets the preset conditions based on the actual offset distance of the centroid and the error area ratio. If it meets the conditions, it indicates that the proposed radiotherapy positioning is qualified; otherwise, it indicates that the proposed radiotherapy positioning is unqualified.

[0024] According to a specific embodiment, the radiotherapy positioning error detection system based on human image segmentation of the present invention further includes: a visualization processing module, used to map the target region masks corresponding to the reference positioning image and the positioning image to be tested to different pseudo-colors respectively, so as to obtain pseudo-color images corresponding to the reference positioning image and the positioning image to be tested, and then superimpose the pseudo-color images corresponding to the reference positioning image and the positioning image to be tested to obtain a visualization image of the detection result.

[0025] Furthermore, the visualization processing module is also used to increase the transparency of the pseudo-color images corresponding to the reference positioning image and the positioning image to be inspected, and to overlay the corresponding pseudo-color images with increased transparency onto the reference positioning image and the positioning image to be inspected, respectively.

[0026] According to a specific embodiment, in the radiotherapy positioning error detection system based on human image segmentation of the present invention, the error calculation module calculates the centroid pixel offset distance into the actual centroid offset distance in the following manner:

[0027]

[0028] Where D represents the actual offset distance of the centroid. Indicates the centroid pixel offset distance. Z represents the camera's focal length, and Z represents the physical distance between the camera and the radiotherapy patient.

[0029] According to one specific implementation, in the radiotherapy positioning error detection system based on human image segmentation of the present invention, the human image segmentation module adopts the PP-HumanSeg human image segmentation model constructed with the MobileNetV3 backbone network, and uses multi-scale feature fusion to fuse image features, and uses stochastic gradient descent for optimization during training.

[0030] Based on the same inventive concept, the present invention also provides a computer-readable storage medium having stored thereon one or more programs that, when executed by one or more processors, implement the radiotherapy positioning error detection method based on human image segmentation provided by the present invention.

[0031] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0032] 1. The radiotherapy positioning error detection method based on human image segmentation provided by this invention first acquires the image of the positioning to be tested corresponding to the radiotherapy positioning to be used in the second radiotherapy of the radiotherapy patient and the reference positioning image corresponding to the radiotherapy positioning used in the first radiotherapy. Then, the target area mask corresponding to the reference positioning image and the positioning image to be tested is obtained using a human image segmentation model. Based on the target area mask of the reference positioning image and the positioning image to be tested, the actual centroid offset distance and error area ratio are calculated to determine whether the radiotherapy positioning to be used in the second radiotherapy is qualified. Therefore, this invention quantifies the radiotherapy positioning deviation of the second radiotherapy by automatically and accurately segmenting the human body area and combining it with the radiotherapy positioning used in the first radiotherapy, avoiding the subjective judgment of positioning error by the radiotherapy technician, thereby significantly improving the detection accuracy of radiotherapy positioning error and accurately assisting the radiotherapy technician in adjusting the radiotherapy positioning, thus improving the safety of radiotherapy.

[0033] 2. In the radiotherapy positioning error detection method based on human image segmentation provided by the present invention, the target region masks corresponding to the reference positioning image and the positioning image to be tested are mapped to different pseudo-colors respectively, and the pseudo-color images corresponding to the reference positioning image and the positioning image to be tested are superimposed to obtain a visual image of the detection result; therefore, the present invention provides a visual reference for radiotherapy technicians to adjust radiotherapy positioning by realizing the visualization of the detection result, thereby improving the work efficiency of radiotherapy technicians in adjusting radiotherapy positioning. Attached Figure Description

[0034] Figure 1 This is a flowchart illustrating the radiotherapy positioning error detection method based on human image segmentation of the present invention.

[0035] Figure 2 This is a visual schematic diagram illustrating the image acquisition process of the present invention;

[0036] Figure 3 This is a visual schematic diagram of the present invention during radiotherapy positioning error detection;

[0037] Figure 4 This is a schematic diagram of the system of the present invention. Detailed Implementation

[0038] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. However, this should not be construed as limiting the scope of the present invention to the following embodiments; all technologies implemented based on the content of the present invention fall within the scope of the present invention.

[0039] like Figure 1 As shown, this invention provides a method for detecting radiotherapy positioning errors based on human image segmentation, which includes the following steps:

[0040] Acquire the reference positioning image corresponding to the radiotherapy positioning used for the first radiotherapy of the radiotherapy patient, and acquire the image of the positioning to be examined corresponding to the radiotherapy positioning to be used for the second radiotherapy of the same radiotherapy patient;

[0041] The reference positioning image and the positioning image to be tested are respectively input into a preset human image segmentation model for human image segmentation to obtain the target region mask corresponding to the reference positioning image and the positioning image to be tested; wherein, the target region mask is a binary mask that represents the human body radiotherapy related region (such as the human body contour region corresponding to the treatment target area) in the positioning image.

[0042] Calculate the centroid pixel offset distance, the number of overlapping pixels, and the number of non-overlapping pixels between the target region masks corresponding to the reference positioning image and the positioning image to be inspected;

[0043] Based on the set camera calibration parameters, the centroid pixel offset distance is calculated as the actual centroid offset distance, and the ratio of the number of non-overlapping pixels to the number of overlapping pixels is calculated to obtain the error area ratio.

[0044] Based on the actual offset distance of the centroid and the error area ratio, it is determined whether the radiotherapy positioning to be used for the next radiotherapy meets the preset conditions. If it does, the proposed radiotherapy positioning is indicated to be qualified; otherwise, the proposed radiotherapy positioning is indicated to be unqualified.

[0045] Therefore, this invention quantifies the radiotherapy positioning deviation in subsequent radiotherapy by automatically and accurately segmenting human body regions and combining the radiotherapy positioning used in the first radiotherapy, avoiding the subjective judgment of positioning errors by radiotherapy technicians. This significantly improves the detection accuracy of radiotherapy positioning errors and precisely assists radiotherapy technicians in adjusting radiotherapy positioning, thereby improving radiotherapy safety.

[0046] In the specific implementation process, the method for obtaining the reference positioning image corresponding to the radiotherapy positioning used for the first radiotherapy treatment of a radiotherapy patient is as follows: Since the radiotherapy positioning used for the first radiotherapy treatment of a radiotherapy patient has been confirmed by radiotherapy experts, it can be considered a radiotherapy positioning with high accuracy, and therefore serves as the reference positioning; therefore, it is necessary to associate the reference positioning image corresponding to the radiotherapy positioning used for the first radiotherapy treatment of each radiotherapy patient with its patient ID and store it in a folder or database with data retrieval function; by searching for the patient ID, the reference positioning image associated with the patient ID can be retrieved. The method for obtaining the image of the positioning to be examined corresponding to the radiotherapy positioning to be used for the second radiotherapy treatment of the same radiotherapy patient is as follows: After the radiotherapy technician moves the radiotherapy patient onto the radiotherapy platform and adjusts the radiotherapy positioning according to experience or a reference positioning, the radiotherapy patient is directly photographed using a camera with calibrated parameters to obtain the image of the positioning to be examined. Specifically, such as... Figure 2 As shown, by entering the patient ID in the record number input field, the radiation therapy technician can retrieve the corresponding baseline positioning image from the specified folder or database and display it in the image display area on the left. After the camera finishes taking the picture, the positioning image to be examined is transmitted to the specified storage location. The data from that storage location is automatically captured and displayed in the image display area in the middle.

[0047] In the specific implementation, the portrait segmentation model is the PP-HumanSeg portrait segmentation model built with the MobileNetV3 backbone network. Furthermore, the model employs multi-scale feature fusion to fuse image features and uses stochastic gradient descent for optimization during training. Multi-scale feature fusion not only improves algorithm accuracy but also reduces the optimal input size, further lowering inference time and increasing the model's receptive field. During model training, transfer learning is used, employing pre-training (with results from a large general portrait segmentation dataset) followed by fine-tuning on a small portrait segmentation dataset. The loss function utilizes a hybrid approach, employing both Lovasz-Softmax and Cross-Entropy Loss. Simultaneously, the optimizer uses SGD (Stochastic Gradient Descent) to enhance the model's generalization ability.

[0048] After the portrait segmentation model is successfully trained, it is deployed and, in conjunction with the selection operation of the human-computer interaction interface, the reference positioning image and the image to be examined of the corresponding radiotherapy patient are selected as inputs to the portrait segmentation model. After the portrait segmentation model completes the portrait segmentation, it outputs the target region mask corresponding to the reference positioning image and the image to be examined.

[0049] In practical implementation, to improve the efficiency of radiotherapy technicians in adjusting radiotherapy positioning and avoid repeated adjustments, after acquiring the target region masks corresponding to the reference positioning image and the positioning image to be examined, the target region masks of the reference positioning image and the positioning image to be examined are mapped to different pseudo-colors (using two pseudo-colors with high distinguishability), thereby obtaining the pseudo-color images corresponding to the reference positioning image and the positioning image to be examined. These pseudo-color images are then superimposed to obtain a visualized image of the detection result. Therefore, this invention can also achieve a visualized presentation of the detection results, providing radiotherapy technicians with a visual reference for adjusting radiotherapy positioning, thereby improving their efficiency in adjusting radiotherapy positioning. Specifically, as shown... Figure 3 As shown, the detection result visualization image obtained by superimposing the reference positioning image and the pseudo-color image corresponding to the positioning image to be tested is stored in a specified storage location. The data in the storage location is automatically captured and the detection result visualization image is presented in the image display area on the right.

[0050] Furthermore, to better present the portrait segmentation effect of the portrait segmentation model; after obtaining the pseudo-color images corresponding to the reference positioning image and the positioning image to be tested, the transparency of the pseudo-color images corresponding to the reference positioning image and the positioning image to be tested is increased, and the corresponding pseudo-color images with increased transparency (such as...) are superimposed on the reference positioning image and the positioning image to be tested respectively. Figure 3 (The image display area on the left and center shows the effect). Thus, by overlaying a pseudo-color image onto the original images of the reference positioning image and the positioning image to be tested, the image segmentation effect of the image segmentation model can be visualized. When the radiotherapy technician finds a slight deviation between the pseudo-color image area on the reference positioning image or the positioning image to be tested and the human body area on its original image, they can click the "Detect" button on the human-computer interaction interface to re-detect the radiotherapy positioning error, thereby avoiding random errors in the image segmentation model that could affect the accuracy of radiotherapy positioning error detection.

[0051] In its implementation, the radiotherapy positioning error detection method based on human image segmentation of this invention first uses the `center_of_mass` function from Python's `scipy` package to calculate the centroids of the target region masks corresponding to the reference positioning image and the positioning image to be tested, respectively. Then, based on the centroids of the target region masks corresponding to the reference positioning image and the positioning image to be tested, the centroid pixel offset distance between the target region masks corresponding to the reference positioning image and the positioning image to be tested is further calculated. The method for calculating the number of overlapping pixels and the number of non-overlapping pixels between the target region masks corresponding to the reference positioning image and the positioning image to be tested is to perform bitwise operations on the pixels of the target region mask, count the results of the operations, and thus calculate the number of overlapping pixels and the number of non-overlapping pixels.

[0052] In the specific implementation process, since the relevant parameters of the camera used to capture the positioning images (such as camera focal length and camera distance) are fixed, the position of the radiotherapy patient in the image coordinate system will shift when the radiotherapy patient moves on the radiotherapy platform. Therefore, according to the set camera calibration parameters, the method for calculating the centroid pixel offset distance into the actual centroid offset distance is as follows:

[0053]

[0054] Where D represents the actual offset distance of the centroid. Indicates the centroid pixel offset distance. Z represents the camera's focal length, and Z represents the physical distance between the camera and the radiotherapy patient.

[0055] Specifically, obtaining the focal length There are several methods to obtain the camera intrinsic parameter matrix, such as using OpenCV's camera calibration functions; calculating it using image width and horizontal field angle; or directly obtaining the metadata of the mobile phone image, obtaining the focal length and sensor size through the EXIF ​​information of the photo, and then converting it into pixel units. Based on this, this invention uses OpenCV's camera calibration functions to obtain the camera intrinsic parameter matrix. First, a 10×7 checkerboard calibration board was prepared, with each checkerboard square measuring 29mm×29mm. To improve calibration accuracy, avoid overfitting, and compensate for different errors, this system takes close-up and long-distance photos from above, below, left, right, diagonally above, and diagonally behind the checkerboard square. All checkerboard images are then calibrated using OpenCV. The `findChessboardCorners` function finds the checkerboard corner points, and the `calibrateCamera` function performs camera calibration, outputting the intrinsic parameter matrix to obtain the intrinsic parameter matrix. .

[0056] In the specific implementation process, based on the actual centroid offset distance and the error area ratio, it is determined whether the proposed radiotherapy positioning for re-radiotherapy meets the preset conditions. If it does, it indicates that the proposed radiotherapy positioning for re-radiotherapy is qualified and can be used for re-radiotherapy. If it does not, it indicates that the proposed radiotherapy positioning for re-radiotherapy is unqualified, and the radiotherapy technician needs to adjust the radiotherapy positioning. After the radiotherapy positioning is adjusted, the radiotherapy positioning error is detected again. The preset conditions can be set such that the actual centroid offset distance does not exceed a set offset distance threshold (e.g., 1mm, 3mm), and the error area ratio does not exceed a set ratio threshold (e.g., 5%). Furthermore, during the specific radiotherapy positioning error detection process, the radiotherapy technician can set a more reasonable error threshold according to the actual situation.

[0057] In the specific implementation process, such as Figure 2 and 3 As shown, in the radiotherapy positioning error detection method based on human image segmentation of this invention, a GUI interface is established on QMainWindow, and various events are triggered using QPushButton, mainly in the "Detection" and "End" buttons. When the mouse clicks the "Detection" button, the human image segmentation module code is triggered, and the detected image is sent to the human image segmentation module to obtain two types of target-background images. When the "End" button is clicked, the "Record Number", "Detection Number", "Detection Result" (including centroid offset and error area ratio) and all content in the three image display boxes are cleared, while the error threshold (preset centroid offset and error area ratio) and preset parameters (camera focal length and camera distance) are retained.

[0058] The QLabel component displays various text information, such as the system name "Positioning Detection System," the "Error Threshold" title, the "Detection Result" title, and "Preset Parameters." The QLineEdit component is an input component used for entering "Record Number" and "Detection Number," setting the "Error Threshold," and setting the camera focal length and distance in the "Preset Parameters." The QCalendarWidget component is a calendar, allowing operators to easily observe the current date and verify the accuracy of the detection images. The QGraphicsView component displays the baseline positioning image (a baseline positioning image overlaid with a pseudo-color image), the image to be tested (a image to be tested overlaid with a pseudo-color image), and a visualization of the detection results (a visualization of the detection results, data display of the actual centroid offset distance, and error area ratio), thereby improving the readability of the radiotherapy positioning error detection process.

[0059] like Figure 4 As shown, the present invention provides a radiotherapy positioning error detection system based on human image segmentation, which includes:

[0060] The image acquisition module is used to acquire the reference positioning image corresponding to the radiotherapy positioning used for the first radiotherapy of the radiotherapy patient, and to acquire the image of the positioning to be examined corresponding to the radiotherapy positioning to be used for the second radiotherapy of the same radiotherapy patient.

[0061] The portrait segmentation module is used to input the reference positioning image and the positioning image to be inspected into a preset portrait segmentation model to perform portrait segmentation, so as to obtain the target region mask corresponding to the reference positioning image and the positioning image to be inspected;

[0062] The error calculation module is used to calculate the centroid pixel offset distance, the number of overlapping pixels, and the number of non-overlapping pixels between the target area masks corresponding to the reference positioning image and the positioning image to be inspected. Based on the set camera calibration parameters, the centroid pixel offset distance is solved into the actual centroid offset distance. The module also calculates the ratio of the number of non-overlapping pixels to the number of overlapping pixels to obtain the error area ratio.

[0063] The error judgment module is used to determine whether the radiotherapy positioning to be used for the next radiotherapy meets the preset conditions based on the actual offset distance of the centroid and the error area ratio. If it meets the conditions, it indicates that the proposed radiotherapy positioning is qualified; otherwise, it indicates that the proposed radiotherapy positioning is unqualified.

[0064] Specifically, the radiotherapy positioning error detection system based on human image segmentation of the present invention further includes: a visualization processing module, used to map the target region masks corresponding to the reference positioning image and the positioning image to be tested to different pseudo-colors respectively, so as to obtain pseudo-color images corresponding to the reference positioning image and the positioning image to be tested, and then superimpose the pseudo-color images corresponding to the reference positioning image and the positioning image to be tested to obtain a visualization image of the detection result.

[0065] Furthermore, the visualization processing module is also used to increase the transparency of the pseudo-color images corresponding to the reference positioning image and the positioning image to be inspected, and to overlay the corresponding pseudo-color images with increased transparency onto the reference positioning image and the positioning image to be inspected, respectively.

[0066] Specifically, in the radiotherapy positioning error detection system based on human face segmentation of the present invention, the error calculation module calculates the centroid pixel offset distance into the actual centroid offset distance in the following way:

[0067]

[0068] Where D represents the actual offset distance of the centroid. Indicates the centroid pixel offset distance. Z represents the camera's focal length, and Z represents the physical distance between the camera and the radiotherapy patient.

[0069] According to one specific implementation, in the radiotherapy positioning error detection system based on human image segmentation of the present invention, the human image segmentation module adopts the PP-HumanSeg human image segmentation model constructed with the MobileNetV3 backbone network, and uses multi-scale feature fusion to fuse image features, and uses stochastic gradient descent for optimization during training.

[0070] In addition, the present invention provides a computer-readable storage medium having stored thereon one or more programs that, when executed by one or more processors, implement the radiotherapy positioning error detection method based on human image segmentation provided by the present invention.

[0071] It should be understood that the system disclosed in this invention can be implemented in other ways. For example, the division of modules is merely a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the communication connection between modules can be through some interfaces, indirect coupling of devices or units, or communication connections, which can be electrical or other forms.

[0072] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one processing unit. The integrated unit described above can be implemented in hardware or as a software functional unit.

[0073] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part 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 the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0074] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting radiotherapy setup errors based on portrait segmentation, characterized in that, Includes the following steps: Acquire the reference positioning image corresponding to the radiotherapy positioning used for the first radiotherapy of the radiotherapy patient, and acquire the image of the positioning to be examined corresponding to the radiotherapy positioning to be used for the second radiotherapy of the same radiotherapy patient; The reference positioning image and the positioning image to be tested are respectively input into a preset portrait segmentation model for portrait segmentation to obtain the target region mask corresponding to the reference positioning image and the positioning image to be tested; Calculate the centroid pixel offset distance, the number of overlapping pixels, and the number of non-overlapping pixels between the target region masks corresponding to the reference positioning image and the positioning image to be inspected; Based on the set camera calibration parameters, the centroid pixel offset distance is calculated as the actual centroid offset distance, and the ratio of the number of non-overlapping pixels to the number of overlapping pixels is calculated to obtain the error area ratio. Based on the actual offset distance of the centroid and the error area ratio, it is determined whether the radiotherapy positioning to be used for the next radiotherapy meets the preset conditions. If it does, the proposed radiotherapy positioning is indicated to be qualified; otherwise, the proposed radiotherapy positioning is indicated to be unqualified.

2. The method for detecting radiotherapy positioning errors based on human image segmentation as described in claim 1, characterized in that, After obtaining the target region masks corresponding to the reference positioning image and the positioning image to be inspected, the target region masks corresponding to the reference positioning image and the positioning image to be inspected are mapped to different pseudo-colors respectively to obtain pseudo-color images corresponding to the reference positioning image and the positioning image to be inspected. Then, the pseudo-color images corresponding to the reference positioning image and the positioning image to be inspected are superimposed to obtain a visualization image of the detection result.

3. The method for detecting radiotherapy positioning errors based on human image segmentation as described in claim 2, characterized in that, After obtaining the pseudo-color images corresponding to the reference positioning image and the positioning image to be inspected, the transparency of the pseudo-color images corresponding to the reference positioning image and the positioning image to be inspected is increased, and the corresponding pseudo-color images with increased transparency are superimposed on the reference positioning image and the positioning image to be inspected respectively.

4. The method for detecting radiotherapy positioning errors based on human image segmentation as described in claim 1, characterized in that, The method for calculating the centroid pixel offset distance into the actual centroid offset distance is as follows: Where D represents the actual offset distance of the centroid. Indicates the centroid pixel offset distance. Z represents the camera's focal length, and Z represents the physical distance between the camera and the radiotherapy patient.

5. The method for detecting radiotherapy positioning errors based on human image segmentation as described in claim 1, characterized in that, The portrait segmentation model is configured as follows: a PP-HumanSeg portrait segmentation model built with a MobileNetV3 backbone network, which uses multi-scale feature fusion to fuse image features and stochastic gradient descent for optimization during training.

6. A radiotherapy positioning error detection system based on human face segmentation, characterized in that, include: The image acquisition module is used to acquire the reference positioning image corresponding to the radiotherapy positioning used for the first radiotherapy of the radiotherapy patient, and to acquire the image of the positioning to be examined corresponding to the radiotherapy positioning to be used for the second radiotherapy of the same radiotherapy patient. A portrait segmentation module is used to perform portrait segmentation on the reference positioning image and the positioning image to be inspected, so as to obtain the target region mask corresponding to the reference positioning image and the positioning image to be inspected; The error calculation module is used to calculate the centroid pixel offset distance, the number of overlapping pixels, and the number of non-overlapping pixels between the target area masks corresponding to the reference positioning image and the positioning image to be inspected. Based on the set camera calibration parameters, the centroid pixel offset distance is solved into the actual centroid offset distance. The module also calculates the ratio of the number of non-overlapping pixels to the number of overlapping pixels to obtain the error area ratio. The error judgment module is used to determine whether the radiotherapy positioning to be used for the next radiotherapy meets the preset conditions based on the actual offset distance of the centroid and the error area ratio. If it meets the conditions, it indicates that the proposed radiotherapy positioning is qualified; otherwise, it indicates that the proposed radiotherapy positioning is unqualified.

7. The radiotherapy positioning error detection system based on human image segmentation as described in claim 6, characterized in that, Also includes: The visualization processing module is used to map the target area masks corresponding to the reference positioning image and the positioning image to be inspected to different pseudo-colors respectively, so as to obtain pseudo-color images corresponding to the reference positioning image and the positioning image to be inspected, and then superimpose the pseudo-color images corresponding to the reference positioning image and the positioning image to be inspected to obtain a visualization image of the detection result.

8. The radiotherapy positioning error detection system based on human image segmentation as described in claim 7, characterized in that, The visualization processing module is also used to increase the transparency of the pseudo-color images corresponding to the reference positioning image and the positioning image to be inspected, and to overlay the corresponding pseudo-color images with increased transparency onto the reference positioning image and the positioning image to be inspected, respectively.

9. The radiotherapy positioning error detection system based on human image segmentation as described in claim 6, characterized in that, The error calculation module converts the centroid pixel offset distance into the actual centroid offset distance in the following way: Where D represents the actual offset distance of the centroid. Indicates the centroid pixel offset distance. Z represents the camera's focal length, and Z represents the physical distance between the camera and the radiotherapy patient.

10. The radiotherapy positioning error detection system based on human image segmentation as described in claim 6, characterized in that, The portrait segmentation module uses the PP-HumanSeg portrait segmentation model built with the MobileNetV3 backbone network, and employs multi-scale feature fusion to fuse image features, as well as stochastic gradient descent for optimization during training.

11. A computer-readable storage medium having one or more programs stored thereon, characterized in that, When the one or more programs are executed by one or more processors, they implement the radiotherapy positioning error detection method based on human face segmentation as described in any one of claims 1 to 5.