Method and system for determining the location of electrodes for tumor electric field therapy
Through DETR model training and image recognition technology, the problem of users being difficult to accurately paste tumor electric field treatment electrodes in their homes is solved, and the accurate determination of electrode positions and improvement of treatment effects are achieved.
Patent Information
- Application Number
- CN202311612990.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2043-11-29
AI Technical Summary
It is difficult for users to accurately determine the adhesion position of the tumor electric field treatment electrode in their homes, which affects the treatment effect.
The DETR model is used for training. By obtaining and marking the user's body paste position image, calculating the decoding layer loss, judging the relationship between the electrode and the human body preset part, and providing operation guidance information to ensure the accurate paste position.
Improve the accuracy of the adhesion position of the tumor electric field treatment electrode in the home environment, ensure the treatment effect and reduce user operation errors.
Smart Images

Figure CN117547730B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a method and system for determining the pasting position of electrodes for tumor electric field therapy. Background Art
[0002] Primary lung cancer is the most common malignant tumor in my country. From a pathological and therapeutic perspective, lung cancer can be broadly divided into two major categories: non-small cell lung cancer (NSCLC) and small cell lung cancer (SCLC). NSCLC accounts for approximately 80% to 85% of cases, including histological subtypes such as adenocarcinoma and squamous cell carcinoma, while the remainder is small cell lung cancer. Limited by the tumor burden of advanced NSCLC, the application of existing local treatments is very limited. Therefore, lung cancer scientists around the world are developing new local treatments, trying to find a sustained local treatment method to add new weapons to the treatment of advanced NSCLC. Tumor Treating Fields (TTFields) is an innovative local physical therapy that is delivered via a portable, non-invasive medical device. The principle is to use low-intensity, medium-frequency (100-300kHz) AC electric fields to act on the microtubules of proliferating cancer cells, disrupting tumor cell mitosis, causing apoptosis of affected cancer cells, and inhibiting tumor growth. TTFields local treatment can currently cover the chest and upper abdominal areas.
[0003] TTFields treatment takes a relatively long time. Studies have shown that the longer the daily use time, the better the effect. Usually, the daily usage time is more than 15 hours. Using the tumor electric field therapy device at home is different from using it in the hospital. Users are often unable to accurately determine the exact pasting position of the treatment electrode. The pasting position of the electrode directly affects the electric field direction, field strength, affected cells, etc. The pasting position of the electrode in tumor electric field therapy directly affects the treatment effect. How to enable users to accurately determine the pasting position of the electrode in TTFields at home is an urgent problem to be solved. Summary of the Invention
[0004] In order to solve the above problems, the present invention provides a method for determining the location of electrodes for tumor electric field therapy, the method comprising the following steps:
[0005] S1, obtaining images of the locations where tumor electric field therapy electrodes are attached to the user's body, taken from a specified angle, annotating the images to obtain a first training set, a second training set, and a test set, inputting the images in the first training set into a DETR model, obtaining the output of each decoding layer in the DETR model, inputting the output into the corresponding prediction head, and obtaining the loss corresponding to each decoding layer;
[0006] S2, calculating a set of decoding layers, and training the DETR model based on the loss corresponding to each decoding layer and the set of decoding layers; wherein the loss corresponding to a decoding layer in the set of decoding layers is less than the loss corresponding to any decoding layer located after the decoding layer in the DETR model, and the set of decoding layers includes the last decoding layer;
[0007] S3, input the position image taken by the user into the trained DETR model, obtain the electrode and the preset part of the human body, and judge whether the identified preset part of the human body meets the requirements. If it does, determine whether the position of the tumor electric field therapy electrode is appropriate based on the electrode and the preset part of the human body. If it is not appropriate, send operation guidance information to the user.
[0008] Preferably, the DETR model is trained according to the loss of each decoding layer and the set of decoding layers, specifically:
[0009] Decoding layer i is taken out from the decoding layer set according to the decoding layer sequence number. If decoding layer i is the last decoding layer, the parameters of the DETR model are directly updated according to the loss corresponding to decoding layer i. Otherwise, the following operations are performed for the taken out decoding layer i:
[0010] S21, saving the parameters of the DETR model, updating the parameters of the decoder i and the layer before the decoding layer i in the DETR model according to the loss corresponding to the decoding layer i, and then randomly selecting at least one image from the first training set and the second training set and inputting it into the DETR model;
[0011] S22, calculate the loss of the Lth decoding layer. If the loss of the Lth decoder is reduced, use the decoder i and the updated parameters located before the decoding layer i to replace the corresponding parameters in the parameters of the DETR model saved in step S11, otherwise, do not replace; where L is the number of decoding layers in the decoder.
[0012] Preferably, the inputting the images in the first training set into the DETR model is specifically as follows:
[0013] Get the batch_size hyperparameter, randomly extract batch_size images from the training set, and divide each of the batch_size images into front, rear, and side shooting angles based on the image annotation information. Record the proportion of front, rear, and side shooting angles in the batch_size images;
[0014] Input batch_size images into the DETR model separately.
[0015] Preferably, randomly selecting at least one image from the first training set and the second training set and inputting it into the DETR model is as follows:
[0016] N images are selected from the first training set and the second training set according to the ratio, wherein the number of the N images from the second training set is greater than the number from the first training set; the selected N images are input into the DETR model; wherein N is a positive integer.
[0017] Preferably, the determining whether the location of the tumor electric field therapy electrode is appropriate based on the electrode and the preset part of the human body is specifically as follows:
[0018] Obtain recognition frames P1 and P2, named shoulders, and P3, named neck, from the preset human body parts to be identified. Calculate the centers D1 and D2 of the recognition frames P1 and P2, and the midpoint D3 of the bottom edge of the recognition frame P3. Use D1, D2, and D3 as the vertices of a triangle to construct a triangular region.
[0019] Obtain the identified electrode and determine whether the electrode pasting position is appropriate based on the relationship between the electrode and the triangular area.
[0020] Preferably, determining whether the electrode pasting position is appropriate based on the relationship between the electrode and the triangular area is specifically as follows:
[0021] Obtain a center line parallel to the long side of the identified electrode target frame, and obtain the perpendicular bisector and base of the triangular area; determine the target line from the perpendicular bisector and base based on the angle between the center line and the perpendicular bisector and base; determine whether the electrode pasting position is appropriate based on the distance between the midpoint of the center line and the midpoint of the target line, and the angle between the center line and the target line.
[0022] In addition, the present invention also provides a system for determining the location of electrodes for tumor electric field therapy, the system comprising the following modules:
[0023] A model loss calculation module is configured to obtain images of the locations where tumor therapy field electrodes are attached to the user's body, taken from a specified angle, annotate the images to obtain a first training set, a second training set, and a test set, input the images in the first training set into the DETR model, obtain the output of each decoding layer in the DETR model, input the output into the corresponding prediction head, and obtain the loss corresponding to each decoding layer;
[0024] A parameter update module is configured to calculate a set of decoding layers and train the DETR model based on the loss corresponding to each decoding layer and the set of decoding layers; wherein the loss corresponding to a decoding layer in the set of decoding layers is less than the loss corresponding to any decoding layer subsequent to the decoding layer in the DETR model, and the set of decoding layers includes the last decoding layer;
[0025] The pasting position determination module is used to input the position image taken by the user into the trained DETR model, obtain the electrode and the preset part of the human body, and judge whether the identified preset part of the human body meets the requirements. If so, it determines whether the pasting position of the tumor electric field therapy electrode is appropriate based on the electrode and the preset part of the human body. If not, it sends operation guidance information to the user.
[0026] Preferably, the DETR model is trained according to the loss of each decoding layer and the set of decoding layers, specifically:
[0027] Decoding layer i is taken out from the decoding layer set according to the decoding layer sequence number. If decoding layer i is the last decoding layer, the parameters of the DETR model are directly updated according to the loss corresponding to decoding layer i. Otherwise, the following operations are performed for the taken out decoding layer i:
[0028] S21, saving the parameters of the DETR model, updating the parameters of the decoder i and the layer before the decoding layer i in the DETR model according to the loss corresponding to the decoding layer i, and then randomly selecting at least one image from the first training set and the second training set and inputting it into the DETR model;
[0029] S22, calculate the loss of the Lth decoding layer. If the loss of the Lth decoder is reduced, use the decoder i and the updated parameters located before the decoding layer i to replace the corresponding parameters in the parameters of the DETR model saved in step S11, otherwise, do not replace; where L is the number of decoding layers in the decoder.
[0030] Preferably, the inputting the images in the first training set into the DETR model is specifically as follows:
[0031] Get the batch_size hyperparameter, randomly extract batch_size images from the training set, and divide each of the batch_size images into front, rear, and side shooting angles based on the image annotation information. Record the proportion of front, rear, and side shooting angles in the batch_size images;
[0032] Input batch_size images into the DETR model separately.
[0033] Preferably, randomly selecting at least one image from the first training set and the second training set and inputting it into the DETR model is as follows:
[0034] N images are selected from the first training set and the second training set according to the ratio, wherein the number of the N images from the second training set is greater than the number from the first training set; the selected N images are input into the DETR model; wherein N is a positive integer.
[0035] Preferably, the determining whether the location of the tumor electric field therapy electrode is appropriate based on the electrode and the preset part of the human body is specifically as follows:
[0036] Obtain recognition frames P1 and P2, named shoulders, and P3, named neck, from the preset human body parts to be identified. Calculate the centers D1 and D2 of the recognition frames P1 and P2, and the midpoint D3 of the bottom edge of the recognition frame P3. Use D1, D2, and D3 as the vertices of a triangle to construct a triangular region.
[0037] Obtain the identified electrode and determine whether the electrode pasting position is appropriate based on the relationship between the electrode and the triangular area.
[0038] Preferably, determining whether the electrode pasting position is appropriate based on the relationship between the electrode and the triangular area is specifically as follows:
[0039] Obtain a center line parallel to the long side of the identified electrode target frame, and obtain the perpendicular bisector and base of the triangular area; determine the target line from the perpendicular bisector and base based on the angle between the center line and the perpendicular bisector and base; determine whether the electrode pasting position is appropriate based on the distance between the midpoint of the center line and the midpoint of the target line, and the angle between the center line and the target line.
[0040] Finally, the present invention also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the above method when executed by a processor.
[0041] The present invention addresses the problem that deviations are likely to occur when users stick electrodes themselves. The electrode sticking position is determined according to the relationship between the identified electrodes and the preset parts of the human body. In addition, the recognition model is improved to address the problem of small number of samples. Specifically, the DETR model is improved to obtain the loss corresponding to each decoding layer of the decoder of the DETR model, and a decoding layer set is calculated. The DETR model is trained according to the loss corresponding to each decoding layer and the decoding layer set, thereby improving the accuracy of the model with limited samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 This is a flow chart of Example 1;
[0044] Figure 2 This is the decoder structure diagram;
[0045] Figure 3 Schematic diagram of preset parts of the human body;
[0046] Figure 4 A schematic diagram of an area determined according to a preset part of the human body;
[0047] Figure 5 Schematic diagram of the electrode pasting position;
[0048] Figure 6 This is a structural diagram of Example 2. DETAILED DESCRIPTION
[0049] In this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0050] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0051] In the first embodiment, the present invention provides a method for determining the location of electrodes for tumor electric field therapy. Figure 1 As shown, the method includes the following steps:
[0052] S1, obtaining images of the locations where tumor electric field therapy electrodes are attached to the user's body, taken from a specified angle, annotating the images to obtain a first training set, a second training set, and a test set, inputting the images in the first training set into a DETR model, obtaining the output of each decoding layer in the DETR model, inputting the output into the corresponding prediction head, and obtaining the loss corresponding to each decoding layer;
[0053] Tumor therapy with electric field therapy lasts for a long time, typically requiring more than ten hours per day for optimal results. Self-treatment at home can help save time, but electrode placement is crucial, and users often misplace the electrodes, impacting treatment effectiveness. The method for determining electrode placement for tumor therapy with electric field therapy provided by the present invention can help users confirm proper placement.
[0054] Specifically, the first step is to build a model to identify the user's designated parts and electrodes. During model training, the present invention obtains an image of the location where the tumor electric field therapy electrode is attached to the user's body, taken from a designated angle. In one embodiment, an image of the head is taken with electrodes attached to the head. The acquired image is then annotated. The annotation tool can use labelme or other tools. The annotated target box includes the electrodes and the preset parts of the human body. In a more specific embodiment, the preset parts of the human body include the ears and the top of the head. Of course, if the user is treating a lung tumor, the preset parts of the human body are the left and right shoulders and the neck. There is no specific limitation on the preset parts of the human body.
[0055] After acquiring the annotated images, a training set and a test set can be obtained. Due to the small number of samples, the present invention further divides the training set into a first training set and a second training set, wherein the number of samples in the first training set is greater than the number of samples in the second training set. In a more specific embodiment, the number of samples in the first training set is three times the number of samples in the second training set.
[0056] During the training process, the sample images in the first training set are input into the DETR model, and the output of each decoding layer in the DETR model is obtained, such as Figure 2As shown, the decoder includes multiple decoding layers. Preferably, the decoding layer is a Transformer Decoder. In the DETR model, the output size of each decoding layer is the same. A prediction head is connected to each decoding layer, and the prediction head includes multiple FFNs. In a specific embodiment, the prediction head of the last decoding layer of the DETR model is copied multiple times, and each copy is connected to the output of a decoding layer. In this way, the loss corresponding to each decoding layer can be calculated like the loss of the DETR model. The loss corresponding to each decoding layer refers to the loss between the output of the prediction head corresponding to this decoding layer and the true value, that is, the loss of the entire DETR model if this decoding layer is used as the last decoding layer.
[0057] In an optional embodiment, the inputting the images in the first training set into the DETR model is specifically as follows:
[0058] Get the batch_size hyperparameter, randomly extract batch_size images from the training set, and divide each of the batch_size images into front, rear, and side shooting angles based on the image annotation information. Record the proportion of front, rear, and side shooting angles in the batch_size images;
[0059] Input batch_size images into the DETR model separately to complete one training.
[0060] S2, calculating a set of decoding layers, and training the DETR model based on the loss corresponding to each decoding layer and the set of decoding layers; wherein the loss corresponding to a decoding layer in the set of decoding layers is less than the loss corresponding to any decoding layer located after the decoding layer in the DETR model, and the set of decoding layers includes the last decoding layer;
[0061] Each decoding layer corresponds to a loss, and different decoding layers have different corresponding losses. If the loss corresponding to a decoding layer is small, it means that this decoding layer and the DETR model part before this decoding layer have better recognition of the target, while the DETR model part after this decoding layer is not good at target recognition. Training this decoder and the network before this decoder according to the loss of this decoding layer will have a better effect on the final result.
[0062] The decoding layer set is obtained by arranging the decoding layers in descending order of their numbers and placing them into a set. If the loss corresponding to a decoding layer is less than the losses corresponding to all subsequent decoding layers, the decoding layer is retained in the set; otherwise, the decoding layer is deleted from the set. The resulting set is the decoding layer set. The decoding layer set also includes the last decoding layer. For example, if the decoder has 7 decoding layers, and the decoding layer numbers and corresponding losses are 7(0.5), 6(0,6), 5(0.7), 4(0.5), 3(0.3), 2(0.5), and 1(0.1), the resulting decoding layer set is {7(0.5), 3(0.3), 1(0.1)}.
[0063] In the present invention, the decoder includes multiple decoding layers. The relationship between the front and back decoding layers is that the farther away from the last decoding layer, the closer to the front, and the smaller the sequence number. For example, there are 7 decoding layers, the last decoding layer is 7, the second to last decoding layer is 6, and the third to last decoding layer is 5. Decoding layer 6 is located behind decoding layer 5, and decoding layer 4 is located in front of decoding layer 5.
[0064] The DETR model is then trained based on the loss of each decoding layer and the set of decoding layers, specifically:
[0065] Decoding layer i is taken out from the decoding layer set according to the decoding layer sequence number. If decoding layer i is the last decoding layer, the parameters of the DETR model are directly updated according to the loss corresponding to decoding layer i. Otherwise, the following operations are performed for the taken out decoding layer i:
[0066] S21, saving the parameters of the DETR model, updating the parameters of the decoder i and the layer before the decoding layer i in the DETR model according to the loss corresponding to the decoding layer i, and then randomly selecting at least one image from the first training set and the second training set and inputting it into the DETR model;
[0067] S22, calculate the loss of the Lth decoding layer. If the loss of the Lth decoder is reduced, use the decoder i and the updated parameters located before the decoding layer i to replace the corresponding parameters in the parameters of the DETR model saved in step S11, otherwise, do not replace; where L is the number of decoding layers in the decoder.
[0068] Still taking the above set of decoding layers as an example, the first decoding layer taken out is 7, which is the last decoding layer. The loss corresponding to decoding layer 7 is directly used to update the DETR model. Then, decoding layer 3 is taken out, and the parameters of decoder 3 and before decoder 3 are updated according to the loss corresponding to decoding layer 3. If the loss of the Lth decoding layer obtained by randomly selecting at least one image from the first training set and the second training set and inputting it into the DETR model is reduced, the updated parameters are retained. Otherwise, the parameters before the parameter update using the loss corresponding to decoder 3 are still used. The parameter update is implemented by forward or backpropagation.
[0069] In an optional embodiment, randomly selecting at least one image from the first training set and the second training set and inputting it into the DETR model is specifically as follows:
[0070] N images are selected from the first training set and the second training set according to the ratio, wherein the number of the N images from the second training set is greater than the number from the first training set; the selected N images are input into the DETR model; wherein N is a positive integer. After the N images are input into the DETR model, the average loss is calculated to obtain the loss of the Lth decoding layer. At least one image is randomly selected from the first training set and the second training set and input into the DETR model. In step S22, during the calculation of the loss of the obtained Lth decoding layer, the loss corresponding to the decoding layer before the Lth layer is calculated without error.
[0071] S3, input the position image taken by the user into the trained DETR model, obtain the electrode and the preset part of the human body, and judge whether the identified preset part of the human body meets the requirements. If it does, determine whether the position of the tumor electric field therapy electrode is appropriate based on the electrode and the preset part of the human body. If it is not appropriate, send operation guidance information to the user.
[0072] During user use, the user takes an image through a mobile terminal. Before taking the image, the mobile terminal application will prompt the user to pay attention to the shooting, such as angle, distance, etc. The image is then uploaded to the server, and the server uses the trained DETR model for recognition to identify the electrodes and the preset parts of the human body, such as Figure 3 As shown, after recognition, it is determined whether the preset part of the human body meets the requirements.
[0073] In one specific embodiment, the determination method involves determining the name and distance of a preset human body part to be identified. For example, if the user is photographing the head, the image will include at least an ear region and a top of the head region. In a more specific embodiment, the positional relationship between the ear region and the top of the head region may also be considered. For another example, if the user is photographing the back of a human body, the image will include at least two shoulder regions and a neck region. The method for determining whether the requirements are met may vary depending on the part of the human body being photographed, and this is not specifically limited by the present invention.
[0074] After making a preliminary judgment that it meets the requirements, the appropriate location for the tumor electric field therapy electrode is determined based on the electrode and the preset part of the human body. Specifically:
[0075] Get the recognition frames P1 and P2 named shoulders and the recognition frame P3 named neck in the preset parts of the human body, calculate the centers D1 and D2 of the recognition frames P1 and P2, and calculate the midpoint D3 of the bottom edge of the recognition frame P3. Use D1, D2 and D3 as the three vertices of the triangle to construct the triangular area, such as Figure 4 As shown;
[0076] Obtain the identified electrode and determine whether the electrode pasting position is appropriate based on the relationship between the electrode and the triangular area.
[0077] Then, the determination of whether the electrode pasting position is appropriate is performed based on the relationship between the electrode and the triangular area. In an optional embodiment, the method is as follows:
[0078] Obtain a center line parallel to the long side of the identified electrode target frame, and obtain the median perpendicular line and base of the triangular area. Determine the target line from the perpendicular line and base according to the angle between the center line, the median perpendicular line, and the base. Determine whether the electrode pasting position is appropriate based on the distance between the midpoint of the center line and the midpoint of the target line, and the angle between the center line and the target line. Figure 5 shown.
[0079] The centerline is a line segment parallel to the long side of the electrode target frame and passing through the midpoint of the short side of the electrode target frame. Electrodes can be pasted horizontally or vertically. Different pasting methods require different judgment methods, and the judgment angles are mainly based on the pasting direction and pasting position. The pasting direction can be determined by the angle with the base or perpendicular bisector of the triangular area, and the pasting position can be determined by the distance from the midpoint of the base or perpendicular bisector of the triangular area.
[0080] Since the judgment conditions for different parts are different, for example, the treatment of lung tumors and the treatment of brain tumors recognize different preset parts of the human body, the methods of judging whether the pasting is appropriate are also different. This can be programmed to achieve different conditions. The specific judgment method is not specifically limited in this invention.
[0081] In an optional embodiment, the operation guidance information prompt issued to the user is prompting the moving direction of a certain electrode, for example, using an arrow to prompt the moving direction and distance with animation effects.
[0082] In the second embodiment, the present invention also provides a system for determining the location of electrodes for tumor electric field therapy. Figure 6 As shown, the system includes the following modules:
[0083] A model loss calculation module is configured to obtain images of the locations where tumor therapy field electrodes are attached to the user's body, taken from a specified angle, annotate the images to obtain a first training set, a second training set, and a test set, input the images in the first training set into the DETR model, obtain the output of each decoding layer in the DETR model, input the output into the corresponding prediction head, and obtain the loss corresponding to each decoding layer;
[0084] A parameter update module is configured to calculate a set of decoding layers and train the DETR model based on the loss corresponding to each decoding layer and the set of decoding layers; wherein the loss corresponding to a decoding layer in the set of decoding layers is less than the loss corresponding to any decoding layer subsequent to the decoding layer in the DETR model, and the set of decoding layers includes the last decoding layer;
[0085] The pasting position determination module is used to input the position image taken by the user into the trained DETR model, obtain the electrode and the preset part of the human body, and judge whether the identified preset part of the human body meets the requirements. If so, it determines whether the pasting position of the tumor electric field therapy electrode is appropriate based on the electrode and the preset part of the human body. If not, it sends operation guidance information to the user.
[0086] Preferably, the DETR model is trained according to the loss of each decoding layer and the set of decoding layers, specifically:
[0087] Decoding layer i is taken out from the decoding layer set according to the decoding layer sequence number. If decoding layer i is the last decoding layer, the parameters of the DETR model are directly updated according to the loss corresponding to decoding layer i. Otherwise, the following operations are performed for the taken out decoding layer i:
[0088] S21, saving the parameters of the DETR model, updating the parameters of the decoder i and the layer before the decoding layer i in the DETR model according to the loss corresponding to the decoding layer i, and then randomly selecting at least one image from the first training set and the second training set and inputting it into the DETR model;
[0089] S22, calculate the loss of the Lth decoding layer. If the loss of the Lth decoder is reduced, use the decoder i and the updated parameters located before the decoding layer i to replace the corresponding parameters in the parameters of the DETR model saved in step S11, otherwise, do not replace; where L is the number of decoding layers in the decoder.
[0090] Preferably, the inputting the images in the first training set into the DETR model is specifically as follows:
[0091] Get the batch_size hyperparameter, randomly extract batch_size images from the training set, and divide each of the batch_size images into front, rear, and side shooting angles based on the image annotation information. Record the proportion of front, rear, and side shooting angles in the batch_size images;
[0092] Input batch_size images into the DETR model separately.
[0093] Preferably, randomly selecting at least one image from the first training set and the second training set and inputting it into the DETR model is as follows:
[0094] N images are selected from the first training set and the second training set according to the ratio, wherein the number of the N images from the second training set is greater than the number from the first training set; the selected N images are input into the DETR model; wherein N is a positive integer.
[0095] Preferably, the determining whether the location of the tumor electric field therapy electrode is appropriate based on the electrode and the preset part of the human body is specifically as follows:
[0096] Obtain recognition frames P1 and P2, named shoulders, and P3, named neck, from the preset human body parts to be identified. Calculate the centers D1 and D2 of the recognition frames P1 and P2, and the midpoint D3 of the bottom edge of the recognition frame P3. Use D1, D2, and D3 as the vertices of a triangle to construct a triangular region.
[0097] Obtain the identified electrode and determine whether the electrode pasting position is appropriate based on the relationship between the electrode and the triangular area.
[0098] Preferably, determining whether the electrode pasting position is appropriate based on the relationship between the electrode and the triangular area is specifically as follows:
[0099] Obtain a center line parallel to the long side of the identified electrode target frame, and obtain the perpendicular bisector and base of the triangular area; determine the target line from the perpendicular bisector and base based on the angle between the center line and the perpendicular bisector and base; determine whether the electrode pasting position is appropriate based on the distance between the midpoint of the center line and the midpoint of the target line, and the angle between the center line and the target line.
[0100] In a third embodiment, the present invention further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the method described in the first embodiment is implemented.
[0101] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by a combination of hardware and software. Based on this understanding, the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a computer product. The present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for determining the location of electrodes for tumor electric field therapy, characterized in that: The method comprises the following steps: S1, obtaining images of the locations where tumor electric field therapy electrodes are attached to the user's body, taken from a specified angle, annotating the images to obtain a first training set, a second training set, and a test set, inputting the images in the first training set into a DETR model, obtaining the output of each decoding layer in the DETR model, inputting the output into the corresponding prediction head, and obtaining the loss corresponding to each decoding layer; S2, calculating a set of decoding layers, and training the DETR model based on the loss corresponding to each decoding layer and the set of decoding layers; wherein the loss corresponding to a decoding layer in the set of decoding layers is less than the loss corresponding to any decoding layer located after the decoding layer in the DETR model, and the set of decoding layers includes the last decoding layer; S3, inputting the position image taken by the user into the trained DETR model to obtain the electrodes and the preset human body part, and determining whether the recognized preset human body part meets the requirements. If so, determining whether the location of the tumor electric field therapy electrode is appropriate based on the electrodes and the preset human body part. If not, providing operation guidance information to the user; The DETR model is trained according to the loss of each decoding layer and the set of decoding layers, specifically: Decoding layer i is taken out from the decoding layer set according to the decoding layer sequence number. If decoding layer i is the last decoding layer, the parameters of the DETR model are directly updated according to the loss corresponding to decoding layer i. Otherwise, the following operations are performed for the taken out decoding layer i: S21, saving the parameters of the DETR model, updating the parameters of decoder i and the layer before the decoding layer i in the DETR model according to the loss corresponding to the decoding layer i, and then randomly selecting at least one image from the first training set and the second training set and inputting it into the DETR model; S22, calculate the loss of the Lth decoding layer. If the loss of the Lth decoder is reduced, use the decoder i and the updated parameters located before the decoding layer i to replace the corresponding parameters in the parameters of the DETR model saved in step S21, otherwise, do not replace; where L is the number of decoding layers in the decoder.
2. The method according to claim 1, wherein The images in the first training set are input into the DETR model, specifically: Get the batch_size hyperparameter, randomly extract batch_size images from the training set, and divide each of the batch_size images into front, rear, and side shooting angles based on the image annotation information. Record the proportion of front, rear, and side shooting angles in the batch_size images; Input batch_size images into the DETR model separately.
3. The method according to claim 2, wherein The step of randomly selecting at least one image from the first training set and the second training set and inputting it into the DETR model is as follows: N images are selected from the first training set and the second training set according to the ratio, wherein the number of the N images from the second training set is greater than the number from the first training set; the selected N images are input into the DETR model; wherein N is a positive integer.
4. The method according to claim 1, wherein The determination of whether the location of the tumor electric field therapy electrode is appropriate based on the electrode and the preset part of the human body is specifically as follows: Obtain recognition frames P1 and P2, named shoulders, and P3, named neck, from the preset human body parts to be identified. Calculate the centers D1 and D2 of the recognition frames P1 and P2, and the midpoint D3 of the bottom edge of the recognition frame P3. Use D1, D2, and D3 as the vertices of a triangle to construct a triangular region. Obtain the identified electrode and determine whether the electrode pasting position is appropriate based on the relationship between the electrode and the triangular area.
5. The method according to claim 4, wherein The determination of whether the electrode pasting position is appropriate based on the relationship between the electrode and the triangular area is specifically as follows: Obtain a center line parallel to the long side of the identified electrode target frame, and obtain the perpendicular bisector and base of the triangular area; determine the target line from the perpendicular bisector and base based on the angle between the center line and the perpendicular bisector and base; determine whether the electrode pasting position is appropriate based on the distance between the midpoint of the center line and the midpoint of the target line, and the angle between the center line and the target line.
6. A system for determining the location of electrodes for tumor electric field therapy, characterized in that: The system includes the following modules: A model loss calculation module is configured to obtain images of the locations where tumor therapy field electrodes are attached to the user's body, taken from a specified angle, annotate the images to obtain a first training set, a second training set, and a test set, input the images in the first training set into the DETR model, obtain the output of each decoding layer in the DETR model, input the output into the corresponding prediction head, and obtain the loss corresponding to each decoding layer; A parameter update module is configured to calculate a set of decoding layers and train the DETR model based on the loss corresponding to each decoding layer and the set of decoding layers; wherein the loss corresponding to a decoding layer in the set of decoding layers is less than the loss corresponding to any decoding layer subsequent to the decoding layer in the DETR model, and the set of decoding layers includes the last decoding layer; The pasting position determination module is used to input the position image taken by the user into the trained DETR model, obtain the electrodes and the preset human body part, and determine whether the identified preset human body part meets the requirements. If so, it determines whether the pasting position of the tumor electric field therapy electrode is appropriate based on the electrodes and the preset human body part. If not, it sends operation guidance information to the user; The DETR model is trained according to the loss of each decoding layer and the set of decoding layers, specifically: Decoding layer i is taken out from the decoding layer set according to the decoding layer sequence number. If decoding layer i is the last decoding layer, the parameters of the DETR model are directly updated according to the loss corresponding to decoding layer i. Otherwise, the following operations are performed for the taken out decoding layer i: S21, saving the parameters of the DETR model, updating the parameters of decoder i and the layer before the decoding layer i in the DETR model according to the loss corresponding to the decoding layer i, and then randomly selecting at least one image from the first training set and the second training set and inputting it into the DETR model; S22, calculate the loss of the Lth decoding layer. If the loss of the Lth decoder is reduced, use the decoder i and the updated parameters located before the decoding layer i to replace the corresponding parameters in the parameters of the DETR model saved in step S21, otherwise, do not replace; where L is the number of decoding layers in the decoder.
7. The system according to claim 6, wherein: The determination of whether the location of the tumor electric field therapy electrode is appropriate based on the electrode and the preset part of the human body is specifically as follows: Obtain recognition frames P1 and P2, named shoulders, and P3, named neck, from the preset human body parts to be identified. Calculate the centers D1 and D2 of the recognition frames P1 and P2, and the midpoint D3 of the bottom edge of the recognition frame P3. Use D1, D2, and D3 as the vertices of a triangle to construct a triangular region. Obtain the identified electrode and determine whether the electrode pasting position is appropriate based on the relationship between the electrode and the triangular area.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Neural network, target detection method, neural network training method and related products
CN113807361A
Electrode attaching position determining method and device and computer readable storage medium
CN114534092A
Multi-lead electrocardio-electrode patch positioning method based on human body surface characteristics
CN116236208A