Method, device, medium and equipment for generating a three-dimensional image of a dental caries according to a text
By using cascade diffusion and regional adaptive diffusion models, three-dimensional images of caries that conform to anatomical standards are generated, solving the problem of inaccurate image generation in caries diagnosis and teaching in existing technologies, and realizing high-precision display of caries lesions and convenient teaching.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV
- Filing Date
- 2026-04-30
- Publication Date
- 2026-07-21
AI Technical Summary
Existing 3D generation technology cannot generate details that conform to anatomical standards in the diagnosis and teaching of dental caries. Furthermore, traditional diagnosis and treatment models rely on physician experience, making it difficult to intuitively demonstrate the progression of the disease to patients, and teaching resources are limited.
Using a cascaded diffusion model and a region-adaptive diffusion model, three-dimensional images of caries are generated from medical descriptions of caries. This includes matching text embedding vectors and root canal structure vectors, and combining the calculation of global and local feature deformation fields to generate three-dimensional images of caries that conform to anatomical standards.
The generated 3D images of decayed teeth are highly accurate, showcasing more details of dental lesions, providing a reference for dental treatment, reducing computational costs, and facilitating the deployment of teaching resources.
Smart Images

Figure CN122435155A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to text-based image technology in artificial intelligence. Background Technology
[0002] Dental caries, as a highly prevalent clinical disease, presents numerous challenges to traditional treatment models due to its core characteristics of "diagnosis relying on experience, operation emphasizing precision, and prognosis requiring long-term monitoring." In the diagnostic process, it relies heavily on physician experience and makes it difficult to visually demonstrate disease progression to patients. In terms of teaching and training, it is limited by the constraints of "high practical risks and a lack of typical case resources," making it difficult for students to engage with diverse and complex clinical scenarios.
[0003] In recent years, artificial intelligence and 3D generation technologies have provided new pathways to address these pain points. AI technology has demonstrated enormous potential in areas such as automated detection of dental caries, risk prediction, and virtual teaching. However, current 3D generation technology still has significant gaps in its application in oral medicine, particularly in its specific application to dental caries. When existing general-purpose 3D generation models are directly transferred to medical scenarios, they often fail to generate details that conform to anatomical standards, and may even exhibit morphological distortion. Summary of the Invention
[0004] The problem this invention aims to solve is to convert text descriptions of teeth into three-dimensional images using artificial intelligence.
[0005] To solve the above problems, the present invention adopts the following solution: The method for generating a three-dimensional image of dental caries based on text according to the present invention includes the steps of receiving medical description text of dental caries and generating a corresponding three-dimensional image of dental caries based on the received medical description text of dental caries. The medical description text of dental caries shall include at least the anatomical location of the tooth and the type of root canal. The step of generating a corresponding three-dimensional image of a carious tooth based on the received medical description text of caries includes: Step SU1: Generate text embedding vectors and root canal structure vectors based on the medical description text of dental caries, and match them with standard tooth model information; the standard tooth model information includes standard tooth 3D point cloud, global principal component deviation mean, global principal component basis matrix, local principal component deviation mean, and local principal component basis matrix; Step SU2: Input the text embedding vector and root canal structure vector into the cascaded diffusion model to obtain the global latent vector and local latent vector; Step SU41: Based on the mean deviation of the global principal components and the basis matrix of the global principal components, perform inverse principal component analysis on the global latent vector to calculate the global characteristic deformation field; and based on the mean deviation of the local principal components and the basis matrix of the local principal components, perform inverse principal component analysis on the local latent vector to calculate the local characteristic deformation field. Step SU42: Superimpose the global feature deformation field and the local feature deformation field onto the standard tooth 3D point cloud according to the point cloud locations to obtain a 3D image of the tooth features. in, The text embedding vector is obtained by segmenting the medical description text of dental caries into words and inputting it into a pre-trained BioBERT model, and then extracting the hidden state of the last layer of the BioBERT model. The root canal structure vector is a vector generated by one-hot encoding of the tooth root canal category; The cascaded diffusion model includes global diffusion model units and local diffusion model units; The global diffusion model unit includes a global conditional feature encoding unit, a global backbone feature encoding unit, a global feature fusion unit, and a global output unit; The local diffusion model unit includes a local conditional feature encoding unit, a local backbone feature encoding unit, a local feature fusion unit, and a local output unit; The global conditional feature encoding unit and the local conditional feature encoding unit: after inputting the text embedding vector and the root canal structure vector into two linear layers respectively, two vectors are obtained. After concatenation, and after linear layer and layer normalization processing, the global conditional feature vector and the local conditional feature vector are obtained respectively. The global backbone feature encoding unit takes the global latent feature vector as input, maps it through a linear layer, concatenates it with the current time step encoding vector, and then compresses it through a linear layer to output the global backbone feature vector. The local backbone feature encoding unit takes the global latent vector and the local latent feature vector as input, maps them through a linear layer, concatenates them with the encoding vector of the current time step, and then compresses them through a linear layer to output the local backbone feature vector. The global feature fusion unit and the local feature fusion unit are each composed of several Transformer blocks connected in series using a multi-head cross-attention mechanism; In the global feature fusion unit, the global backbone feature vector is used as the Q vector of the Transformer block, and the global conditional feature vector is used as the K vector and V vector. In the local feature fusion unit, the local backbone feature vector is used as the Q vector of the Transformer block, and the local conditional feature vector is used as the K vector and V vector. When the global diffusion model unit is executed, the time steps traverse from T1 to 1, and the global backbone feature encoding unit, global feature fusion unit, and global output unit are executed in a loop for T1 rounds accordingly. Initially, the global latent feature vector is randomly generated. In other time steps, the output of the global output unit of the previous time step is used as the global latent feature vector. The global latent vector is the output of the global output unit in the last time step. Where T1 is the total number of time steps of the global diffusion model unit. When the local diffusion model unit is executed, the time steps traverse from T2 to T1, and the local backbone feature encoding unit, local feature fusion unit, and local output unit are executed in a loop for T2 rounds accordingly. Initially, the local latent feature vector is randomly generated. At other time steps, the output of the local output unit of the previous time step is used as the local latent feature vector. The local latent vector is the output of the local output unit at the last time step. Where T2 is the total number of time steps of the local diffusion model unit.
[0006] Furthermore, according to the method for generating a three-dimensional image of dental caries based on text according to the present invention, if the tooth described in the medical description text of dental caries has a lesion, a caries feature vector is generated, and the coordinates of the caries center, the extent of the lesion area, and the caries deformation weighting table are determined; the step of generating a corresponding three-dimensional image of dental caries based on the received medical description text of dental caries further includes: Step SU3: Input the caries feature vector into the region adaptive diffusion model to obtain the deformation field of the lesion region; After step SU42, perform the following steps: Step SU43: Weight the deformation field of the caries region according to the caries deformation weighting table and overlay it with the three-dimensional image of tooth features to obtain a preliminary three-dimensional image of the caries. Step SU44: Smooth and adjust the preliminary 3D model of the caries, and output the final 3D model of the caries. The regional adaptive diffusion model includes a signal fusion unit, an encoding input unit, an encoding / decoding unit, and a decoding output unit; The signal fusion unit takes the caries feature vector as input. The caries feature vector is mapped through two linear layers connected by GELU activation and then added to the current time step encoding vector to form a residual injection vector. The coding input unit takes the caries feature deformation field as input, transposes it, and outputs the caries feature coding deformation field after convolution by the convolutional layer. The encoding / decoding unit includes an encoding unit, a decoding unit, and an intermediate layer; The encoding unit comprises three encoding blocks with different dimensional features arranged in sequence: a first encoding block, a second encoding block, and a third encoding block; wherein the input of the first encoding block is connected to the output of the encoding input unit; the encoding blocks are connected to each other through a channel dimension adaptation layer; The decoding unit comprises three decoding blocks arranged in sequence: a third decoding block, a second decoding block, and a first decoding block. The first, second, and third decoding blocks correspond sequentially to the first, second, and third encoding blocks, respectively, and the dimensional features of the decoding blocks and their corresponding encoding blocks are identical. The input of the third decoding block is connected to the intermediate layer and the output of the third encoding block via a skip connection block. The input of the second decoding block is connected to the outputs of the third decoding block and the second encoding block via a skip connection block. The input of the first decoding block is connected to the outputs of the second decoding block and the first encoding block via a skip connection block. The output of the first decoding block is connected to the decoding output unit. The jump connection block includes a dimension splicing unit and a channel dimension adaptation layer; The dimension splicing unit is used for splicing along the vector dimension; The channel dimension adaptation layer includes a convolutional layer for channel dimension feature adaptation and transformation; The encoding block and decoding block include two residual blocks, wherein the first residual block is output to the second residual block through residual concatenation; The intermediate layer includes two residual blocks connected by a multi-head attention block. The output of the encoding unit is processed sequentially by the first residual block, the multi-head attention block and the second residual block of the intermediate layer and then input to the decoding unit. The residual block includes two convolutional blocks. The residual injection vector is aligned by the number of dimensions and channels, added to the output of the convolutional layer of the previous convolutional block, and then input into the next convolutional block. The convolutional block includes group normalization and convolutional layers arranged in sequence. The input of the residual block is group normalized and then activated by SILU before being input to the convolutional layer, and then output through the convolutional layer. The multi-head attention block adopts a four-head self-attention mechanism; The decoding output unit takes the output of the encoding / decoding unit as input, and after group normalization, SILU activation and convolution of the convolutional layer, it is transposed and output. When the region adaptive diffusion model is executed, the time step traverses from T3 to 1, and the signal fusion unit, encoding input unit, encoding / decoding unit, and decoding output unit cyclically execute T3 rounds accordingly; where T3 is the total number of time steps in the region adaptive diffusion model; initially, when the time step is T3, the caries feature deformation field input to the encoding unit is randomly generated; at other time steps, the caries feature deformation field is the output of the decoding output unit of the previous time step; the output of the decoding output unit at the last time step is the caries region deformation field finally output by the region adaptive diffusion model. Step SU44 includes step SU443; Step SU443: Traverse the points at the edge of the lesion area and readjust their positions according to the following formula: dnew(i)=a*dold(i)+b*davg(i); where, dnew(i) represents the adjusted center distance of the i-th edge point of the lesion area; dold(i) represents the center distance of the i-th edge point of the lesion area before adjustment; davg(i) represents the average center distance between adjacent points of the i-th edge point of the lesion region.
[0007] Furthermore, in the method for generating a three-dimensional image of dental caries based on text according to the present invention, step SU44 includes steps SU441 and SU442 before step SU443; Step SU441: Traverse the points at the edge of the lesion area, calculate the angle between the point and the outer normal vector of a ring of neighboring points at a distance of 10 units, and if the angle is greater than 90°, shrink the point a certain distance toward the center of the standard tooth three-dimensional point cloud. Step SU442: Traverse the points within the lesion area. If the depression depth of a point is less than dmin, adjust the depression depth of the point to dmin. If the depression depth of a point is greater than dmax, adjust the depression depth of the point to dmax. Here, dmin and dmax are obtained by mapping the lesion depth information. The depression depth refers to the distance difference between the center distance of a point in the point cloud and the center distance of a standard tooth 3D point cloud.
[0008] Furthermore, the method for generating a three-dimensional image of dental caries based on text according to the present invention further includes the step of computing standard tooth model information based on three-dimensional tooth points in a healthy tooth classification set, comprising: Step SA1: Average the 3D point cloud of teeth in the set to obtain a standard 3D point cloud of teeth. Step SA2: Based on the 3D point cloud of teeth in the set and the corresponding standard 3D point cloud of teeth, obtain the global deformation field matrix for each tooth sample in the set. DG=[dg(j)|j∈[1..M]]T=[d(1),d(2),...,d(M)]T; where, DG is the global deformation field matrix; T denotes matrix transpose; M is the number of tooth samples in the set; dg(j) is the vector of the deformation field column arrangement of the j-th tooth sample in the corresponding tooth classification set; dg(j)={dd(j,i)=p(j,i)-pn(i)|i∈[1..K0]}; where, dd(j,i) is the deformation of the i-th contour point in the deformation field of the j-th tooth sample in the set; p(j,i) represents the distance of the i-th contour point of the j-th tooth sample in the set from the coordinate center in three-dimensional polar coordinates; pn(i) represents the distance from the center of the coordinate system to the i-th contour point of the standard tooth 3D point cloud in 3D polar coordinates; Step SA3: Calculate the global principal component deviation mean Mglobal=avg{dg(j)|j∈[1..M]}; where avg represents the mean calculation function; Step SA4: Calculate the covariance matrix of the global deformation field matrix, then calculate the eigenvalues of the covariance matrix, select the K1 eigenvalues with the largest eigenvalues, and calculate the eigenvectors corresponding to these K1 eigenvalues to form the global principal component basis matrix. Step SA5 involves comparing the absolute values of the deformation variables of each contour point within the deformation field dg(j) of the tooth sample, extracting the contour points with the largest deformation variables (KF values in total) to obtain the set of contour point locations with the largest deformation. Then, the sets of contour point locations with the largest deformation variables from each tooth sample deformation field are intersected to obtain the set of contour point locations with common large deformations across all tooth sample deformation fields. Finally, based on the contour points in the set of common large deformation locations, the deformation variables are extracted from the tooth sample deformation field dg(j) to obtain the local deformation field dl(j), and thus the local deformation field matrix is obtained. DL=[dl(j)|j∈[1..M]]T=[d(1),d(2),...,d(M)]T; where, DL is the local deformation field matrix; T denotes matrix transpose; dl(j) represents the local deformation field of the column orientation of the j-th tooth sample in the set. dl(j) = {dl(j,i) | i ∈ [1..K0]}; where, dl(j,i) represents the deformation of the i-th contour point in the local deformation field of the j-th tooth sample in the set. If i∈Scom, then dl(j,i)=dg(j,i), otherwise dl(j,i)=0; Scom represents the set of contour point positions where the deformation fields of all tooth samples have a large deformation. Step SA6: Calculate the mean local principal component deviation Mlocal=avg{dl(j)|j∈[1..M]}; where avg represents the mean calculation function; Step SA7: Calculate the covariance matrix of the local deformation field matrix, then calculate the eigenvalues of the covariance matrix, select the K2 eigenvalues with the largest eigenvalues, and calculate the eigenvectors corresponding to these K2 eigenvalues to form the local principal component basis matrix; The healthy teeth classification set is a collection of tooth point cloud classification information; the tooth point cloud classification information includes tooth anatomical location, tooth root canal category, and tooth three-dimensional point cloud.
[0009] The apparatus for generating a three-dimensional image of dental caries based on text according to the present invention includes a module for receiving medical description text of dental caries and a module for generating a corresponding three-dimensional image of dental caries based on the received medical description text of dental caries. The medical description text of dental caries shall include at least the anatomical location of the tooth and the type of root canal. The module that generates a corresponding three-dimensional image of dental caries based on the received medical description text of dental caries includes: Module MU1: Generates text embedding vectors and root canal structure vectors based on the medical description text of dental caries, and matches them with standard tooth model information; the standard tooth model information includes standard tooth 3D point cloud, global principal component deviation mean, global principal component basis matrix, local principal component deviation mean, and local principal component basis matrix; Module MU2: Inputs the text embedding vector and root canal structure vector into the cascaded diffusion model to obtain the global latent vector and local latent vector; Module MU41 performs inverse principal component analysis on the global latent vectors based on the mean of the global principal component deviations and the global principal component basis matrix to calculate the global characteristic deformation field. It also performs inverse principal component analysis on the local latent vectors based on the mean of the local principal component deviations and the local principal component basis matrix to calculate the local characteristic deformation field. Module MU42 superimposes the global feature deformation field and the local feature deformation field onto the standard tooth 3D point cloud according to the point cloud to obtain a 3D image of tooth features. in, The text embedding vector is obtained by segmenting the medical description text of dental caries into words and inputting it into a pre-trained BioBERT model, and then extracting the hidden state of the last layer of the BioBERT model. The root canal structure vector is a vector generated by one-hot encoding of the tooth root canal category; The cascaded diffusion model includes global diffusion model units and local diffusion model units; The global diffusion model unit includes a global conditional feature encoding unit, a global backbone feature encoding unit, a global feature fusion unit, and a global output unit; The local diffusion model unit includes a local conditional feature encoding unit, a local backbone feature encoding unit, a local feature fusion unit, and a local output unit; The global conditional feature encoding unit and the local conditional feature encoding unit: after inputting the text embedding vector and the root canal structure vector into two linear layers respectively, two vectors are obtained. After concatenation, and after linear layer and layer normalization processing, the global conditional feature vector and the local conditional feature vector are obtained respectively. The global backbone feature encoding unit takes the global latent feature vector as input, maps it through a linear layer, concatenates it with the current time step encoding vector, and then compresses it through a linear layer to output the global backbone feature vector. The local backbone feature encoding unit takes the global latent vector and the local latent feature vector as input, maps them through a linear layer, concatenates them with the encoding vector of the current time step, and then compresses them through a linear layer to output the local backbone feature vector. The global feature fusion unit and the local feature fusion unit are each composed of several Transformer blocks connected in series using a multi-head cross-attention mechanism; In the global feature fusion unit, the global backbone feature vector is used as the Q vector of the Transformer block, and the global conditional feature vector is used as the K vector and V vector. In the local feature fusion unit, the local backbone feature vector is used as the Q vector of the Transformer block, and the local conditional feature vector is used as the K vector and V vector. When the global diffusion model unit is executed, the time steps traverse from T1 to 1, and the global backbone feature encoding unit, global feature fusion unit, and global output unit are executed in a loop for T1 rounds accordingly. Initially, the global latent feature vector is randomly generated. In other time steps, the output of the global output unit of the previous time step is used as the global latent feature vector. The global latent vector is the output of the global output unit in the last time step. Where T1 is the total number of time steps of the global diffusion model unit. When the local diffusion model unit is executed, the time steps traverse from T2 to T1, and the local backbone feature encoding unit, local feature fusion unit, and local output unit are executed in a loop for T2 rounds accordingly. Initially, the local latent feature vector is randomly generated. At other time steps, the output of the local output unit of the previous time step is used as the local latent feature vector. The local latent vector is the output of the local output unit at the last time step. Where T2 is the total number of time steps of the local diffusion model unit.
[0010] Furthermore, according to the apparatus for generating a three-dimensional image of a carious tooth based on text according to the present invention, if the tooth described in the medical description text of caries has a lesion, a caries feature vector is generated, and the coordinates of the caries center, the extent of the lesion area, and the caries deformation weighting table are determined; the module for generating a corresponding three-dimensional image of a carious tooth based on the received medical description text of caries further includes: Module MU3: Inputs the caries feature vector into the region adaptive diffusion model to obtain the deformation field of the lesion region; The following module is executed after module MU42: Module MU43: After weighting the deformation field of the caries region according to the caries deformation weighting table, it is superimposed with the 3D image of tooth features to obtain a preliminary 3D image of the caries. Module MU44: Smooths and adjusts the initial 3D model of tooth decay, and outputs the final 3D model of tooth decay; The regional adaptive diffusion model includes a signal fusion unit, an encoding input unit, an encoding / decoding unit, and a decoding output unit; The signal fusion unit takes the caries feature vector as input. The caries feature vector is mapped through two linear layers connected by GELU activation and then added to the current time step encoding vector to form a residual injection vector. The coding input unit takes the caries feature deformation field as input, transposes it, and outputs the caries feature coding deformation field after convolution by the convolutional layer. The encoding / decoding unit includes an encoding unit, a decoding unit, and an intermediate layer; The encoding unit comprises three encoding blocks with different dimensional features arranged in sequence: a first encoding block, a second encoding block, and a third encoding block; wherein the input of the first encoding block is connected to the output of the encoding input unit; the encoding blocks are connected to each other through a channel dimension adaptation layer; The decoding unit comprises three decoding blocks arranged in sequence: a third decoding block, a second decoding block, and a first decoding block. The first, second, and third decoding blocks correspond sequentially to the first, second, and third encoding blocks, respectively, and the dimensional features of the decoding blocks and their corresponding encoding blocks are identical. The input of the third decoding block is connected to the intermediate layer and the output of the third encoding block via a skip connection block. The input of the second decoding block is connected to the outputs of the third decoding block and the second encoding block via a skip connection block. The input of the first decoding block is connected to the outputs of the second decoding block and the first encoding block via a skip connection block. The output of the first decoding block is connected to the decoding output unit. The jump connection block includes a dimension splicing unit and a channel dimension adaptation layer; The dimension splicing unit is used for splicing along the vector dimension; The channel dimension adaptation layer includes a convolutional layer for channel dimension feature adaptation and transformation; The encoding block and decoding block include two residual blocks, wherein the first residual block is output to the second residual block through residual concatenation; The intermediate layer includes two residual blocks connected by a multi-head attention block. The output of the encoding unit is processed sequentially by the first residual block, the multi-head attention block and the second residual block of the intermediate layer and then input to the decoding unit. The residual block includes two convolutional blocks. The residual injection vector is aligned by the number of dimensions and channels, added to the output of the convolutional layer of the previous convolutional block, and then input into the next convolutional block. The convolutional block includes group normalization and convolutional layers arranged in sequence. The input of the residual block is group normalized and then activated by SILU before being input to the convolutional layer, and then output through the convolutional layer. The multi-head attention block adopts a four-head self-attention mechanism; The decoding output unit takes the output of the encoding / decoding unit as input, and after group normalization, SILU activation and convolution of the convolutional layer, it is transposed and output. When the region adaptive diffusion model is executed, the time step traverses from T3 to 1, and the signal fusion unit, encoding input unit, encoding / decoding unit, and decoding output unit cyclically execute T3 rounds accordingly; where T3 is the total number of time steps in the region adaptive diffusion model; initially, when the time step is T3, the caries feature deformation field input to the encoding unit is randomly generated; at other time steps, the caries feature deformation field is the output of the decoding output unit of the previous time step; the output of the decoding output unit at the last time step is the caries region deformation field finally output by the region adaptive diffusion model. The module MU44 includes module MU443; The module MU443: Traverses the points at the edge of the lesion area and readjusts their positions according to the following formula: dnew(i)=a*dold(i)+b*davg(i); where, dnew(i) represents the adjusted center distance of the i-th edge point of the lesion area; dold(i) represents the center distance of the i-th edge point of the lesion area before adjustment; davg(i) represents the average center distance between adjacent points of the i-th edge point of the lesion region.
[0011] Furthermore, in the apparatus for generating three-dimensional images of dental caries based on text according to the present invention, module MU44 further includes modules MU441 and MU442; The module MU441: Traverses the points at the edge of the lesion area, calculates the angle between the point and the outer normal vector of a ring of neighboring points at a distance of 10 units, and if the angle is greater than 90°, shrinks the point a certain distance toward the center of the standard tooth 3D point cloud. The module MU442: Traverses the points within the lesion area. If the depression depth of a point is less than dmin, the depression depth of the point is adjusted to dmin. If the depression depth of a point is greater than dmax, the depression depth of the point is adjusted to dmax. Here, dmin and dmax are obtained by mapping the lesion depth information. The depression depth refers to the distance difference between the center distance of a point in the point cloud and the center distance of a standard tooth 3D point cloud.
[0012] Furthermore, the apparatus for generating three-dimensional images of dental caries based on text according to the present invention further includes a module for cloud computing standard tooth model information based on three-dimensional tooth points in a healthy tooth classification set, comprising: Module MA1 averages the 3D point cloud of teeth within the set to obtain a standard 3D point cloud of teeth. Module MA2 calculates the global deformation field matrix by combining the 3D point clouds of teeth within the set with the deformation field of each tooth sample within the set, based on the 3D point clouds of teeth within the set and the corresponding standard 3D point clouds of teeth. DG=[dg(j)|j∈[1..M]]T=[d(1),d(2),...,d(M)]T; where, DG is the global deformation field matrix; T denotes matrix transpose; M is the number of tooth samples in the set; dg(j) is the vector of the deformation field column arrangement of the j-th tooth sample in the corresponding tooth classification set; dg(j)={dd(j,i)=p(j,i)-pn(i)|i∈[1..K0]}; where, dd(j,i) is the deformation of the i-th contour point in the deformation field of the j-th tooth sample in the set; p(j,i) represents the distance of the i-th contour point of the j-th tooth sample in the set from the coordinate center in three-dimensional polar coordinates; pn(i) represents the distance from the center of the coordinate system to the i-th contour point of the standard tooth 3D point cloud in 3D polar coordinates; Module MA3 calculates the global principal component deviation mean Mglobal=avg{dg(j)|j∈[1..M]}; where avg represents the mean calculation function; Module MA4 calculates the covariance matrix of the global deformation field matrix, then calculates the eigenvalues of the covariance matrix, selects the K1 largest eigenvalues, and calculates the eigenvectors corresponding to these K1 eigenvalues to form the global principal component basis matrix. Module MA5 extracts the contour points with the largest deformation values in the tooth sample deformation field dg(j) by comparing the absolute values of the deformation values of each contour point. This yields the set of contour point locations with the largest deformation. Then, the intersection of these sets is obtained to identify the common contour point locations with significant deformation across all tooth sample deformation fields. Finally, based on the contour points in this common set, the deformation values are extracted from the tooth sample deformation field dg(j) to obtain the local deformation field dl(j), which in turn yields the local deformation field matrix. DL=[dl(j)|j∈[1..M]]T=[d(1),d(2),...,d(M)]T; where, DL is the local deformation field matrix; T denotes matrix transpose; dl(j) represents the local deformation field of the column orientation of the j-th tooth sample in the set. dl(j) = {dl(j,i) | i ∈ [1..K0]}; where, dl(j,i) represents the deformation of the i-th contour point in the local deformation field of the j-th tooth sample in the set. If i∈Scom, then dl(j,i)=dg(j,i), otherwise dl(j,i)=0; Scom represents the set of contour point positions where the deformation fields of all tooth samples have a large deformation. Module MA6 calculates the mean of the local principal component deviations, Mlocal=avg{dl(j)|j∈[1..M]}; where avg represents the mean calculation function. Module MA7 calculates the covariance matrix of the local deformation field matrix, then calculates the eigenvalues of the covariance matrix, selects the K2 largest eigenvalues, and calculates the eigenvectors corresponding to these K2 eigenvalues to form the local principal component basis matrix. The healthy teeth classification set is a collection of tooth point cloud classification information; the tooth point cloud classification information includes tooth anatomical location, tooth root canal category, and tooth three-dimensional point cloud.
[0013] According to a machine-readable medium of the present invention, the medium stores a set of program instructions that can be loaded and executed by a machine; when the set of program instructions stored in the medium is loaded and executed by a machine, the above-described method for generating a three-dimensional image of dental caries based on text can be implemented.
[0014] According to an electronic device of the present invention, the device includes a processor and a memory connected together; the memory stores a set of program instructions; when the set of program instructions stored in the memory is executed by the processor, the device can implement the above-described method for generating a three-dimensional image of dental caries based on text.
[0015] The technical effects of this invention are as follows: 1. Compared with general text-based image technology, the three-dimensional images of teeth generated by the method of this invention have higher accuracy and fidelity, can show more details of dental lesions, provide dentists with reference for later treatment, and can also provide convenience for teaching. 2. Compared with general text-based image processing technologies, the artificial intelligence model involved in this invention has a much smaller number of parameters, thereby greatly reducing computing power costs, thus reducing clinic and teaching costs, and making it easier to deploy. Attached Figure Description
[0016] Figure 1 This is a data flow diagram of an embodiment of the method of the present invention.
[0017] Figure 2 This is a schematic diagram of the structure of an embodiment of the electronic device of the present invention.
[0018] Figure 3 This is a schematic diagram of the cascade diffusion model according to an embodiment of the present invention.
[0019] Figure 4 This is a schematic diagram of the structure of the condition feature encoding unit in an embodiment of the present invention.
[0020] Figure 5 This is a schematic diagram of the structure of the global backbone feature coding unit in an embodiment of the present invention.
[0021] Figure 6 This is a schematic diagram of the structure of the local backbone feature coding unit in an embodiment of the present invention.
[0022] Figure 7 This is a schematic diagram of the structure of the region adaptive diffusion model in an embodiment of the present invention.
[0023] Figure 8 This is a schematic diagram of the signal fusion unit in an embodiment of the present invention.
[0024] Figure 9 This is a schematic diagram of the residual block in an embodiment of the present invention. Detailed Implementation
[0025] The present invention will now be described in further detail with reference to the accompanying drawings.
[0026] Figure 2An example of an electronic device is provided, which is a general-purpose computer device in the von Neumann architecture, comprising at least a processor 101 and a memory 102 connected together. The memory 102 is used to store computer program instruction sets and data. The processor 101 implements the method for generating three-dimensional images of dental caries from text, as described in this invention, by loading and executing the computer program instruction sets stored in the memory 102. The memory 102 is also referred to as a machine-readable medium in this invention, typically a sustainable storage device, including but not limited to disks, magnetic tapes, solid-state drives, etc. It should be noted that the processor 101 here is a component capable of executing computer program instructions in a broad sense, not limited to a general-purpose processor, or even a single component. For example, in this embodiment, the processor 101 is a combination of a CPU and a GPU, meaning that the functions implemented by the processor 101 are jointly implemented by the CPU and the GPU.
[0027] The method for generating three-dimensional images of dental caries from text according to the present invention includes: The steps of receiving medical description text of dental caries and generating corresponding 3D images of dental caries based on the received medical description text of dental caries; and, The steps for receiving training samples and training the model based on the received training samples are as follows.
[0028] The step of receiving the medical description text of dental caries indicates that the medical description text of dental caries is the input of this invention.
[0029] A dental caries medical description text is a descriptive text describing the condition of dental caries, including tooth information and caries information. Tooth information includes the tooth's anatomical location, root canal type, and other descriptions of the tooth's shape. Teeth are typically classified by anatomical location as: upper central incisors, lower central incisors, upper lateral incisors, lower lateral incisors, upper canines, lower canines, upper first premolars, lower first premolars, upper second premolars, lower second premolars, upper first posterior molars, lower first posterior molars, upper second posterior molars, and lower second posterior molars. Root canal type refers to the number of tooth roots. Tooth roots can be single-rooted, double-rooted, triple-rooted, or fused-rooted. Caries information includes the presence of caries, the anatomical location of the lesion, the severity of the lesion, and the depth of the lesion. The anatomical location of the lesion refers to its position on the tooth.
[0030] The steps for generating a corresponding 3D image of a carious tooth based on the received medical description text of caries are as follows: Figure 1 It includes initialization steps, cascade diffusion model execution steps, region adaptive diffusion model execution steps, and dental caries 3D image construction steps.
[0031] Initialization steps, i.e. Figure 1Step SU1 generates text embedding vectors, root canal structure vectors, and caries feature vectors based on the medical description of dental caries, and matches them with standard tooth model information to determine the coordinates of the caries center, the extent of the lesion region, and the caries deformation weighting table. Based on the generated vectors, this step includes the following three sub-steps: the generation step of the text embedding vector, the generation step of the root canal structure vector, and the generation step of the caries feature vector.
[0032] In this specific embodiment, the text embedding vector generation steps involve segmenting the medical description text of dental caries into words and then inputting it into a pre-trained BioBERT model. The last hidden state of the BioBERT model is then extracted. More specifically, the segmentation of the medical description text of dental caries is performed using the tokenizer of the pre-trained BioBERT model, i.e.: Sequence = Tokenizer(Text); where Sequence is the token vector obtained from word segmentation, Text is the medical description text of dental caries, and Tokenizer is a procedure call of the BioBERT model.
[0033] The last hidden state of the BioBERT model is a matrix. In this embodiment, the first row of this matrix is selected as the output text embedding vector. The final output text embedding vector has 768 dimensions.
[0034] In the root canal structure vector generation step, the root canal structure vector is generated by one-hot encoding of the tooth root canal category, and can be represented as a 4-dimensional vector: {R1, R2, R3, R4}. If the root canal type of the tooth is single root, then R1=1, R2=R3=R4=0; If the tooth root canal is classified as having two roots, then R2=1, R1=R3=R4=0; If the tooth root canal category is three, then R3=1, R1=R2=R4=0; If the root canal type of the tooth is a fused root, then R4=1, R1=R2=R3=0.
[0035] In the process of generating the dental caries feature vector, the feature vector is composed of encoded and concatenated information characterizing the presence of dental caries, the anatomical location of the lesion, the severity of the lesion, and the depth of the lesion. More specifically, in this embodiment, the dental caries feature vector includes: One vector element is used to indicate whether dental caries are present. C1 vector elements representing C1 different locations of the lesion on the tooth, generated by one-hot encoding of the anatomical location of the lesion. C2 vector elements representing C2 different lesion severity levels are generated by one-hot encoding based on the severity of the lesion. A vector element used to represent the depth of the lesion.
[0036] Therefore, the caries feature vector is C0 = C1 + C2 + a 2-dimensional vector. The unique heat encoding of the lesion's anatomical location and severity can refer to the unique heat encoding of the root canal structure vector mentioned above. In this embodiment, C1 is 8, C2 is 4, and C0 is 14. Those skilled in the art will understand that in other specific embodiments, the lesion's anatomical location and severity can be further subdivided. For example, the lesion's anatomical location can be divided into 40 locations, corresponding to C1 being 40; the severity of the lesion can be divided into 10 levels, corresponding to C2 being 10. Thus, C0 is 52, and the corresponding caries feature vector is a 52-dimensional vector.
[0037] The execution steps of the cascade diffusion model are as follows: Figure 2 In step SU2, the text embedding vector and root canal structure vector are input into the cascaded diffusion model to obtain the global latent vector and local latent vector.
[0038] Standard tooth model information refers to the corresponding standard tooth model information obtained by matching the tooth's anatomical location and root canal type from a standard tooth model library. Standard tooth model information includes standard tooth 3D point clouds, global principal component deviation mean, etc. Global principal component basis matrix, local principal component deviation mean, and local principal component basis matrix.
[0039] The coordinates of the caries center are determined through mapping based on the anatomical location of the lesion. The caries deformation weighting table, based on the caries center coordinates and the mapping of lesion severity and depth information, determines the lesion area and the core lesion area. Then, based on the distance of the point cloud relative to the core lesion area, a weighting coefficient is set for the point cloud surrounding the core lesion area. Specifically, the weighting coefficient for the point cloud within the core lesion area is 1, and the weighting coefficient for the point cloud outside the core lesion area decreases progressively based on the distance from the core lesion area.
[0040] The standard tooth 3D point cloud has K0 points, global principal component counts K1 points, local principal component counts K2 points, and caries deformation weighted table point cloud counts K3 points. Each point cloud weighting coefficient in the caries deformation weighted table corresponds to one point. In this embodiment, K0 is preferably 10000, K1 is preferably 30, K2 is preferably 24, and K3 is preferably 1000.
[0041] Reference Figure 3 The cascaded diffusion model comprises global diffusion model units and local diffusion model units. The global diffusion model unit includes a global conditional feature encoding unit, a global backbone feature encoding unit, a global feature fusion unit, and a global output unit. The local diffusion model unit includes a local conditional feature encoding unit, a local backbone feature encoding unit, a local feature fusion unit, and a local output unit.
[0042] Global conditional feature encoding unit and local conditional feature encoding unit: The text embedding vector and root canal structure vector are respectively input into two linear layers for projection, resulting in two vectors. After concatenation, and after linear layer and layer normalization processing, the global conditional feature vector and local conditional feature vector are obtained, respectively. More specifically, the global conditional feature encoding unit and the local conditional feature encoding unit have the same structure and can be collectively referred to as conditional feature encoding units.
[0043] More specifically, in this embodiment, referring to Figure 4, the conditional feature encoding unit includes two parallel linear layers: linear layer A and linear layer B. The 768-dimensional text embedding vector is linearly mapped by linear layer A to obtain a CT-dimensional text conditional encoding vector; the 4-dimensional root canal structure vector is linearly mapped by linear layer B to obtain a CT-dimensional root canal conditional encoding vector. The CT-dimensional text conditional encoding vector and the CT-dimensional root canal conditional encoding vector are concatenated to obtain a CT*2-dimensional conditional encoding vector; the CT*2-dimensional conditional encoding vector is then processed by linear layer C and layer normalization, and then calculated using the GELU activation function to obtain the final CT-dimensional conditional feature vector. The conditional feature vector output by the global conditional feature encoding unit is the global conditional feature vector, and the conditional feature vector output by the local conditional feature encoding unit is the local conditional feature vector. Clearly, linear layer A inputs a 768-dimensional vector and outputs a CT-dimensional vector; linear layer B inputs a 4-dimensional vector and outputs a CT-dimensional vector; and linear layer C inputs a CT*2-dimensional vector and outputs a CT-dimensional vector. In this embodiment, CT is preferably 14.
[0044] It should be noted that although the global conditional feature coding unit and the local conditional feature coding unit have the same structure, their linear layer parameters are different. In other words, the global conditional feature coding unit and the local conditional feature coding unit are two independent conditional feature coding units.
[0045] Global backbone feature encoding unit: Takes the global latent feature vector as input, maps it through a linear layer, concatenates it with the current time-step encoding vector, and then compresses it through a linear layer to output the global backbone feature vector. Local backbone feature encoding unit: Takes both the global latent vector and the local latent feature vector as input, maps them through linear layers respectively, concatenates them with the current time-step encoding vector, and then compresses them through a linear layer to output the local backbone feature vector.
[0046] It should be noted that, during execution, the global diffusion model unit and the local diffusion model unit iterate cyclically under the control of time steps, which are required to traverse from T1 and T2 respectively to 1. Here, T1 is the total number of time steps in the global diffusion model unit, and T2 is the total number of time steps in the local diffusion model unit. In this embodiment, T1 and T2 are preferably 1000.
[0047] Specifically, in the global diffusion model unit, the time step traverses from T1 to 1, and the global backbone feature encoding unit, global feature fusion unit, and global output unit execute T1 rounds in turn. Initially, when the time step is T1, the global latent feature vector is randomly generated. At other time steps, that is, when the time step is T1-1 to 1, the global latent feature vector is the output of the global output unit of the previous time step. The output of the global output unit at the last time step, that is, the output of the global output unit when the time step is 1, is the global latent vector.
[0048] Specifically, within the local diffusion model unit, the time step iterates from T2 to 1, with the local backbone feature encoding unit, local feature fusion unit, and local output unit performing T2 rounds in a loop. Initially, at time step T2, the local latent feature vector is randomly generated; at other time steps, from T2-1 to 1, the local latent feature vector is the output of the local output unit from the previous time step; the output of the local output unit at the last time step, i.e., at time step 1, is the local latent vector.
[0049] In other words, the input of the local diffusion model unit depends on the output of the global diffusion model unit. Thus, the global diffusion model unit and the local diffusion model unit form a cascade relationship.
[0050] In the global diffusion model unit of this embodiment, the global latent feature vector and the output global latent vector are K1-dimensional vectors. The initial K1-dimensional global latent feature vector is obtained by random sampling using standard Gaussian noise. In the global backbone feature encoding unit, referencing... Figure 5 The K1-dimensional global latent feature vector is mapped by a linear layer D and then activated by the GELU activation function to output a 128-dimensional global latent feature encoding vector. This 128-dimensional global latent feature encoding vector is concatenated with the 128-dimensional current time step encoding vector to obtain a 256-dimensional global backbone feature encoding vector. This 256-dimensional global backbone feature encoding vector is then mapped by a linear layer E to output a 128-dimensional global backbone feature vector. Clearly, linear layer D takes a K1-dimensional vector as input and outputs a 128-dimensional vector; linear layer E takes a 256-dimensional vector as input and outputs a 128-dimensional vector.
[0051] In the local diffusion model unit of this embodiment, the local latent feature vector and the output local latent vector are K2-dimensional vectors. The initial K2-dimensional local latent vector is obtained by random sampling using standard Gaussian noise. In the local backbone feature encoding unit, referring to... Figure 6The K1-dimensional global latent vector is mapped by a linear layer F and then activated by the GELU activation function to output a 128-dimensional global latent encoding vector. The K2-dimensional local latent feature vector is mapped by a linear layer G and then activated by the GELU activation function to output a 128-dimensional local latent feature encoding vector. The 128-dimensional global latent encoding vector, the 128-dimensional local latent feature encoding vector, and the 128-dimensional current time step encoding vector are concatenated to obtain a 384-dimensional local backbone feature encoding vector. The 384-dimensional local backbone feature encoding vector is then mapped by a linear layer H to obtain a 128-dimensional local backbone feature vector. Clearly, linear layer F takes a K1-dimensional vector as input and outputs a 128-dimensional vector; linear layer G takes a K2-dimensional vector as input and outputs a 128-dimensional vector; linear layer H takes a 384-dimensional vector as input and outputs a 128-dimensional vector.
[0052] In both the global and local diffusion model units, the 128-dimensional current time step encoding vector is obtained by encoding the time step of the current round using a time step encoder. In the time step encoders of both units, the current round's time step is sinusoidally encoded into a time step position vector, and then mapped through two linear layers connected by GELU activation to obtain the corresponding time step encoding vector.
[0053] In this embodiment, the time step position vector is calculated according to the following formula: P(i) = sin(t / pow(10000, 2*i / d_model), when i is even; P(i) = cos(t / pow(10000, 2*i / d_model), when i is odd; where... d_model is the dimension of the time step position vector, which is preferably 128 in this embodiment; i is the dimension of the time step position vector, and i takes values from 0 to d_model-1; P(i) represents the i-th element in the time step position vector; t is the time step of the current round; sin is the sine function, cos is the cosine function, and pow is the exponential function.
[0054] In the time-step encoders of the global diffusion model unit and the local diffusion model unit, the first linear layer has an input dimension of 128 and an output dimension of 256. After passing through the GELU activation function, it is input to the second linear layer; the second linear layer has an input dimension of 256 and an output dimension of 128. The 128-dimensional vector output by the second linear layer is the current time-step encoded vector.
[0055] It should be noted that the internal parameters of the linear layer in the time-step encoder of the global diffusion model unit and the local diffusion model unit are different.
[0056] The global feature fusion unit and the local feature fusion unit are each composed of several Transformer blocks connected in series using a multi-head cross-attention mechanism. More specifically, the global feature fusion unit consists of four Transformer blocks connected in series, and the local feature fusion unit consists of three Transformer blocks connected in series. Each Transformer block is composed of a multi-head cross-attention submodule and a feedforward network submodule. The multi-head cross-attention submodule uses a four-head attention mechanism, with each head having a dimension of 32. The feedforward network submodule includes two connected linear layers. The first linear layer expands the 128-dimensional network to 256-dimensional networks, and the second linear layer compresses the 256-dimensional network back to 128-dimensional networks. The two linear layers are connected via GELU activation. The multi-head cross-attention submodule and the feedforward network submodule are connected via residual connections and layer normalization. In the global feature fusion unit, the global backbone feature vector is used as the Q vector of the Transformer block, and the global conditional feature vector is used as the K and V vectors. In the local feature fusion unit, the local backbone feature vector is used as the Q vector of the Transformer block, and the local conditional feature vector is used as the K and V vectors. The Q, K, and V vectors of the aforementioned Transformer block are also the query vector Q, key vector K, and value vector V in the multi-head cross-attention submodule. The residual connections within and between the multi-head cross-attention submodule and the feedforward network submodule are all sums of the inputs and outputs of the preceding modules.
[0057] The feedforward network submodule consists of two linear layers connected by GELU activation. The first linear layer expands the 128 dimensions to 256 dimensions, and the second linear layer compresses the 256 dimensions back to 128 dimensions.
[0058] Both the global output unit and the local output unit consist of two linear layers connected by GELU activation. In the global output unit, the first linear layer expands the 128-dimensional space to 256 dimensions, and the second linear layer compresses the 256-dimensional space to K1 dimensions, ultimately outputting a K1-dimensional global latent vector. In the local output unit, the first linear layer expands the 128-dimensional space to 256 dimensions, and the second linear layer compresses the 256-dimensional space to K2 dimensions, ultimately outputting a K2-dimensional local latent vector.
[0059] The execution steps of the region adaptive diffusion model are as follows: Figure 1 Step SU3 in the model inputs the caries feature vector into the region adaptive diffusion model to obtain the deformation field of the lesion region. (Refer to...) Figure 7 The regional adaptive diffusion model includes a signal fusion unit, an encoding input unit, an encoding / decoding unit, and a decoding output unit.
[0060] The signal fusion unit takes the caries feature vector as input. The caries feature vector is passed through two linear mappings connected by GELU activation, and then added to the current time-step encoding vector to form the residual injection vector. More specifically, in this embodiment, referring to... Figure 8 The signal fusion unit comprises two linear layers connected by GELU activation: linear layer I and linear layer J. A C0-dimensional caries feature vector is mapped through linear layers I and J to obtain a 256-dimensional caries feature encoding vector. This 256-dimensional caries feature encoding vector is then added to a 256-dimensional current time step encoding vector to output a 256-dimensional residual injection vector. The current time step encoding vector is obtained by encoding the current time step using a time step encoder. In this embodiment, linear layer I has an input dimension of 14 and an output dimension of 256; linear layer J has an input dimension of 256 and an output dimension of 256.
[0061] The 256-dimensional current time step encoded vector is obtained by encoding the current round's time step using a time step encoder. The time step encoder in the signal fusion unit has the same structure as the time step encoders in the aforementioned global diffusion model unit and local diffusion model unit, but the configuration parameters differ. In the time step encoder of the region adaptive diffusion model, the time step position vector has a dimension of 64. The first linear layer has an input dimension of 64 and an output dimension of 256; the second linear layer has an input dimension of 256 and an output dimension of 256. The 256-dimensional vector output by the second linear layer is the current time step encoded vector in the signal fusion unit.
[0062] The encoding input unit takes a caries feature deformation field of (L,3) as input, transposes it into the form of (3,L), and then outputs a caries feature encoded deformation field of (64,L) after convolution by a convolutional layer. Here, L is the length of the deformation field sequence, which is the same as the number of point clouds K3 in the caries deformation weighting table; 3 and 64 are the number of channels; the convolutional layer configuration parameters are: one-dimensional convolution, 3 input channels, 64 output channels, and a kernel size of 3.
[0063] The encoding / decoding unit includes an encoding unit, a decoding unit symmetrical to the encoding unit, and an intermediate layer connecting the encoding unit and the decoding unit. The (64,L) caries feature encoded deformation field output by the encoding input unit is encoded and decoded by the encoding / decoding unit to output a (64,L) caries feature fusion deformation field.
[0064] The encoding unit comprises three encoding blocks with different dimensional features arranged sequentially: a first encoding block, a second encoding block, and a third encoding block. In this embodiment, the first encoding block has a dimensional feature of length L and 64 channels; the second encoding block has a dimensional feature of length L / 2 and 128 channels; and the third encoding block has a dimensional feature of length L / 4 and 256 channels. The input of the first encoding block is connected to the output of the encoding input unit; the encoding blocks are connected through a channel dimension adaptation layer. The channel dimension adaptation layer includes a convolutional layer for channel dimension feature adaptation and transformation.
[0065] The decoding unit comprises three decoding blocks with different dimensional features arranged sequentially: a third decoding block, a second decoding block, and a first decoding block. The decoding and encoding units are symmetrically arranged, with the first, second, and third decoding blocks corresponding to the first, second, and third encoding blocks, respectively, and the dimensional features of the decoding blocks and their corresponding encoding blocks are identical. Specifically, the input of the third decoding block is connected to the intermediate layer and the output of the third encoding block via a skip connection block; the input of the second decoding block is connected to the outputs of the third and second encoding blocks via a skip connection block; the input of the first decoding block is connected to the outputs of the second and first encoding blocks via a skip connection block; and the output of the first encoding block is connected to the decoding output unit. The skip connection block includes a dimension concatenation unit and a channel dimension adaptation layer. The dimension concatenation unit is used for concatenation along the vector dimension. The channel dimension adaptation layer is used for channel dimension feature adaptation and transformation, and its structure is the same as the channel dimension adaptation layer between encoding blocks. Specifically, in this embodiment: In the skip connection block connected to the input of the third decoding block, the vector with 256 channels and a length of L / 4 output from the intermediate layer and the third coding block is concatenated by the dimension concatenation unit into a vector with 512 channels and a length of L / 4. After being processed by the channel dimension adaptation layer, it forms a vector with 256 channels and a length of L / 4, which is then input to the third decoding block. The channel dimension adaptation layer has the following input dimension features: length L / 4, number of channels 512, and output dimension features: length L / 4, number of channels 256. In the skip connection block connected to the input of the second decoding block, the vector with 256 channels and a length of L / 4 output from the third decoding block is padded to form a vector with 256 channels and a length of L / 2; the vector with a length of L / 2 and 128 channels output from the second encoding block is padded to form a vector with 256 channels and a length of L / 2; the two vectors with 256 channels and a length of L / 2 are concatenated by a dimension concatenation unit to form a vector with 512 channels and a length of L / 2, and then processed by a channel dimension adaptation layer to form a vector with 128 channels and a length of L / 2, which is then input to the second decoding block; wherein, the channel dimension adaptation layer has input dimension features of length L / 2 and 512 channels, and output dimension features of length L / 2 and 128 channels; In the skip connection block connected to the input of the first decoding block, the vector with 128 channels and length L / 2 output from the second decoding block is padded to form a vector with 128 channels and length L; the vector with length L and 64 channels output from the first encoding block is padded to form a vector with 128 channels and length L; the two vectors with 128 channels and length L are concatenated by a dimension concatenation unit to form a vector with 256 channels and length L, and then processed by a channel dimension adaptation layer to form a vector with 64 channels and length L, which is then input to the first decoding block; wherein, the channel dimension adaptation layer has input dimension features of length L and 256 channels, and output dimension features of length L and 64 channels.
[0066] Both the encoding and decoding blocks consist of two residual blocks; the first residual block is output to the second residual block via a residual concatenation. The intermediate layer consists of two residual blocks connected by a multi-head attention block. The output of the encoding unit is processed sequentially by the first residual block, the multi-head attention block, and the second residual block of the intermediate layer before being input to the decoding unit. The intermediate layer, the third encoding block, and the third decoding block share the same dimensional characteristics.
[0067] The encoding block, decoding block, and residual blocks in the intermediate layers have the same structure. A residual block consists of two convolutional blocks. The residual injection vector, after being aligned by the number of channels, is added to the output of the previous convolutional block and then input into the next convolutional block. Specifically... Figure 9 In the example, the two convolutional blocks are convolutional block A and convolutional block B. The residual injection vector, after being aligned to the number of channels, is added to the output of convolutional block A and used as the input of convolutional block B. Aligning the residual injection vector to the number of channels involves first mapping the 256-dimensional residual injection vector through a linear layer to a dimension matching the number of channels of the dimensional features of the encoding and decoding blocks. Then, it is copied according to the vector length of the dimensional features of the encoding and decoding blocks, transforming it into a matrix corresponding to the dimensional features of the encoding, decoding, and intermediate layers. Here, the matrix refers to a matrix composed of vectors with different numbers of channels.
[0068] Each convolutional block of the residual block includes a group normalization layer and a convolutional layer arranged sequentially. The input of the residual block is group normalized, activated by SILU, and then input to the convolutional layer, before being output. The group normalization process involves 8 groups. The convolutional layer uses one-dimensional convolution with a kernel size of 3 and padding of 1. The number of input and output channels of the convolutional layer matches the dimensionality of the encoding block, decoding block, and intermediate layers. Alternatively, the dimensionality of the encoding block, decoding block, and intermediate layers refers to the input and output dimensionality of the residual block's convolutional layer.
[0069] The multi-head attention block in the intermediate layer employs a four-head self-attention mechanism with 256 input channels and 64 dimensions per head (one-quarter of the input channels). The attention block first standardizes the input features through group normalization with 8 groups. The standardized features are then mapped through a one-dimensional convolutional layer with a kernel size of 1, 256 input channels, and 768 output channels (256×3), generating a fused feature tensor containing query Q, key K, and value V. This tensor is then split into three groups of 256-dimensional features, serving as Q, K, and V vectors. Each of Q, K, and V is further divided into four attention heads, each corresponding to a 64-dimensional feature. Attention scores are calculated using matrix multiplication and normalized with Softmax. After weighted fusion with the V vector, the multi-head outputs are concatenated into a 256-dimensional feature, which is then projected back to the original channel dimension through a one-dimensional convolutional layer with a kernel size of 1 and 256 input and output channels. The original channel dimension here is a length of L / 4, and the number of channels is 256.
[0070] The decoding output unit takes the (64,L) deformation field output by the encoding / decoding unit as input. After group normalization, SILU activation, and convolution by a convolutional layer, a (3,L) deformation field is formed. The (3,L) deformation field is then transposed to obtain the (L,3) deformation field. The group normalization is performed in 8 groups, the convolutional layer is a one-dimensional convolution with a kernel size of 3 and padding of 1.
[0071] It should be noted that during execution, the region adaptive diffusion model iterates cyclically under the control of time steps. The time steps are required to traverse from T3 to 1, and the signal fusion unit, encoding input unit, encoding / decoding unit, and decoding output unit correspondingly execute T3 rounds cyclically. Here, T3 is the total number of time steps in the region adaptive diffusion model, which is preferably 1000 in this embodiment. Initially, when the time step is T3, the caries feature deformation field of (L,3) input by the encoding unit is randomly generated. In other time steps, i.e., when the time steps are T3-1 to 1, the caries feature deformation field of (L,3) is the output of the decoding output unit of the previous time step; the output of the decoding output unit in the last time step, i.e., the deformation field of (L,3) output by the decoding output unit when the time step is 1, is the caries region deformation field finally output by the region adaptive diffusion model.
[0072] The steps for constructing a 3D image of dental caries, namely Figure 1 Step SU4 in the process involves constructing a feature deformation field based on the global and local latent vectors output from the cascaded diffusion model execution steps. This field is then compared with a standard 3D template of teeth to obtain a 3D image of the tooth features. Next, the deformation field of the caries region is weighted and superimposed based on the caries center point to obtain a 3D image of the caries. After modification and adjustment, the image is output, and the process is divided into the following steps: Step SU41 involves constructing the characteristic deformation field. This is achieved by performing an inverse principal component analysis (PCA) transformation on the global latent vectors based on the global principal component deviation mean and the global principal component basis matrix, thus calculating the global characteristic deformation field. Similarly, an inverse principal component analysis (PCA) transformation is performed on the local latent vectors based on the local principal component deviation mean and the local principal component basis matrix, thus calculating the local characteristic deformation field. The inverse principal component analysis transformation is equivalent to the inverse PCA transformation, and the specific calculation formula is as follows: Dglobal=Mglobal+Pglobal*Zglobal; Dlocal = Mlocal + Plocal * Zlocal; where... Dglobal is the global characteristic deformation field, Mglobal is the global principal component deviation mean, Pglobal is the global principal component basis matrix, and Zglobal is the global latent vector. Dlocal is the local characteristic deformation field, Mlocal is the mean of the local principal component deviation, Plocal is the local principal component basis matrix, and Zlocal is the local latent vector.
[0073] Step SU42 involves overlaying a standard 3D tooth template, which means superimposing the global and local feature deformation fields onto the standard 3D tooth point cloud according to the point cloud locations to obtain a 3D image of the tooth features. This step can be expressed by the formula: Xspecial = Xtemplate + Dglobal + Dlocal; where... Xspecial represents the 3D point cloud of a 3D image of tooth features, while Xtemplate represents the standard 3D point cloud of a tooth.
[0074] Step SU43 involves weighted superposition and fusion of the deformation field of the caries region based on the center point. Specifically, the deformation field of the caries region is weighted according to the caries deformation weighting table and then superimposed on the 3D image of the tooth features to obtain a preliminary 3D image of the caries. This step can be expressed by the formula: X1 = Sumpoint(Xspecial, Ddisease * Wdisease); where... X1 represents the point cloud of the preliminary 3D model of the caries region, Ddisease is the deformation field of the caries area, and Wdisease is the point cloud weighting coefficient in the caries deformation weighting table. Ddisease*Wdisease represents multiplying the point cloud points one by one; Sumpoint represents adding the point cloud points. The points in Ddisease*Wdisease are determined by the points of the point cloud weighting coefficients in the caries deformation weighting table. The center point is implicit in the caries deformation weighting table.
[0075] Step SU44, smoothing and refining the 3D caries image, that is, smoothing and refining the preliminary 3D caries image to output the final 3D caries image. The final output 3D image is represented as a point cloud. The number of point clouds corresponding to the aforementioned caries region deformation field and caries deformation weighting table is fixed. However, according to the point cloud density of the standard tooth 3D point cloud, the number of point clouds within the aforementioned lesion area may exceed the number of point clouds corresponding to the caries region deformation field and caries deformation weighting table. The point cloud corresponding to the caries deformation weighting table expands around the core lesion area, and may even consist entirely of points within the core lesion area. Therefore, the points in the point cloud that exceed the caries deformation weighting table within the aforementioned lesion area appear as convex points in the preliminary 3D caries image, especially at the edges of the lesion area, appearing very abrupt. Therefore, smoothing and refining are required. In this embodiment, this step includes the following steps: Step SU441: Traverse the points at the edge of the lesion area and calculate the angle between the point and the outer normal vector of a ring of neighboring points at a distance of 10 units. If the angle is greater than 90°, shrink the point a certain distance toward the center of the standard tooth 3D point cloud. Step SU442: Traverse the points within the lesion area. If the depression depth of a point is less than dmin, adjust the depression depth of the point to dmin. If the depression depth of a point is greater than dmax, adjust the depression depth of the point to dmax. Here, dmin and dmax are obtained by mapping the lesion depth information. The depression depth refers to the distance difference between the center distance of a point in the point cloud and the center distance of a standard tooth 3D point cloud. Step SU443: Traverse the points at the edge of the lesion area and readjust their positions according to the following formula: dnew(i)=a*dold(i)+b*davg(i); where, dnew(i) represents the adjusted center distance of the i-th edge point of the lesion area; dold(i) represents the center distance of the i-th edge point of the lesion area before adjustment; davg(i) represents the average center distance between adjacent points of the i-th edge point of the lesion region.
[0076] In the above steps, the center distance refers to the distance between the point and the center of the standard tooth 3D point cloud.
[0077] In another alternative implementation, if the lesion area is small, steps SU441 and / or SU442 can be omitted when smoothing and adjusting the preliminary three-dimensional image of the caries.
[0078] Model training and construction of a standard tooth model library The cascade diffusion model and the region adaptive diffusion model involved in the above-described method of this invention are both artificial intelligence models that require training to obtain various parameters in the model. The samples required for training the model come from 3D scan data of various tooth samples. The standard tooth model library involved is a database storing information on standard tooth models. The information on standard tooth models corresponds to the anatomical location of teeth and the type of tooth root canals. The construction of the standard tooth model library also comes from 3D scan data of various tooth samples. Before model training and the construction of the standard tooth model library, the 3D scan data of these tooth samples first need to be preprocessed.
[0079] The preprocessing of 3D scan data of tooth samples involves classifying these samples according to their anatomical location, root canal type, and health condition. Simultaneously, the 3D scan data is standardized and converted into a 3D point cloud based on a standard point cloud, thus forming a healthy tooth classification set and a diseased tooth classification set. These sets are collections of tooth point cloud classification information. This information includes the tooth's anatomical location, root canal type, and the 3D point cloud itself. Here, the point cloud is a collection of contour points of the tooth sample. A standard point cloud refers to a point cloud where the points are contour points at pre-defined specific locations.
[0080] In this embodiment, the pre-defined specific position refers to the projection of contour points onto a sphere such that these contour projection points are uniformly distributed on the sphere. This sphere is typically centered on the center of the point cloud. Therefore, in three-dimensional polar coordinates centered on the center of the sphere, the angular parameters of each contour point are fixed. At this time, the three-dimensional point cloud of the tooth can be represented as: {p(i)|i∈[1..K0]};where, p(i) represents the distance of the i-th contour point from the coordinate center in three-dimensional polar coordinates; K0 represents the number of point clouds; The angle parameter of the i-th contour point in three-dimensional polar coordinates is determined by looking up a table; using p(i) and the angle parameter, the coordinate data can be converted into coordinate data in a three-dimensional Cartesian coordinate system. Of course, the three-dimensional point cloud of a tooth can also be represented as: {(x(i),y(i),z(i))|i∈[1..K0]} in a three-dimensional Cartesian coordinate system. Here, x(i), y(i), and z(i) represent the coordinates of the i-th contour point along the X, Y, and Z axes in the three-dimensional Cartesian coordinate system, respectively.
[0081] It should be noted that the different coordinate systems used to represent 3D point clouds of teeth are merely different representation methods; they are essentially the same.
[0082] Standard tooth model information includes standard tooth 3D point cloud, global principal component deviation mean, global principal component basis matrix, local principal component deviation mean, and local principal component basis matrix. Standard tooth model information corresponding to specific tooth anatomical locations and root canal categories is obtained from the 3D point cloud of teeth in the corresponding healthy tooth classification set. The specific processing includes the following steps: Step SA1 involves averaging the 3D point clouds of teeth within the set to obtain a standard 3D point cloud of teeth. In the aforementioned 3D polar coordinates, this step involves calculating the average center distance of each contour point. 3D point clouds of teeth represented in other coordinate systems can first be converted to 3D polar coordinates, then the average center distance of each contour point can be calculated, and finally the 3D point cloud in 3D polar coordinates can be converted back to a standard 3D point cloud of teeth in the corresponding coordinate system. Step SA2: Based on the 3D point cloud of teeth in the set and the corresponding standard 3D point cloud of teeth, obtain the global deformation field matrix for each tooth sample in the set. DG=[dg(j)|j∈[1..M]] T =[dg(1),dg(2),...,dg(M)] T ;in, DG is the global deformation field matrix; T denotes matrix transpose; M is the number of tooth samples in the set; dg(j) is the vector of the deformation field column arrangement of the j-th tooth sample in the corresponding tooth classification set; dg(j) = {dg(j,i) = p(j,i) - pn(i) | i ∈ [1..K0]}; where, dg(j,i) is the deformation of the i-th contour point in the deformation field of the j-th tooth sample in the set; p(j,i) represents the distance of the i-th contour point of the j-th tooth sample in the set from the coordinate center in three-dimensional polar coordinates; pn(i) represents the distance from the center of the coordinate system to the i-th contour point of the standard tooth 3D point cloud in 3D polar coordinates; Step SA3: Calculate the global principal component deviation mean Mglobal=avg{dg(j)|j∈[1..M]}; where avg represents the mean calculation function; Step SA4 involves performing principal component analysis on the global deformation field matrix. This includes calculating the covariance matrix of the global deformation field matrix, then calculating the eigenvalues of this covariance matrix, selecting the K1 largest eigenvalues, and calculating the eigenvectors corresponding to these K1 eigenvalues to form the global principal component basis matrix. Pglobal=[Pgs(n)|n∈[1..K1]]=[Pgs(1),Pgs(2),...,Pgs(K1)]; where, Pgs(n) represents the nth feature vector with dimension K0 arranged in columns; Step SA5 involves comparing the absolute values of the deformation variables of each contour point within the deformation field dg(j) of the tooth sample, extracting the contour points with the largest deformation variables (KF values in total) to obtain the set of contour point locations with the largest deformation. Then, the sets of contour point locations with the largest deformation variables from each tooth sample deformation field are intersected to obtain the set of contour point locations with common large deformations across all tooth sample deformation fields. Finally, based on the contour points in the set of common large deformation locations, the deformation variables are extracted from the tooth sample deformation field dg(j) to obtain the local deformation field dl(j), and thus the local deformation field matrix is obtained. DL=[dl(j)|j∈[1..M]] T =[d(1),d(2),...,d(M)] T ;in, DL is the local deformation field matrix; T denotes matrix transpose; dl(j) represents the local deformation field of the column orientation of the j-th tooth sample in the set. dl(j) = {dl(j,i) | i ∈ [1..K0]}; where, dl(j,i) represents the deformation of the i-th contour point in the local deformation field of the j-th tooth sample in the set. If i∈Scom, then dl(j,i)=dg(j,i), otherwise dl(j,i)=0; Scom represents the set of contour point positions where the deformation fields of all tooth samples have a large deformation. Step SA6: Calculate the mean local principal component deviation Mlocal=avg{dl(j)|j∈[1..M]}; where avg represents the mean calculation function; Step SA7 involves performing principal component analysis on the local deformation field matrix. This includes calculating the covariance matrix of the local deformation field matrix, then calculating the eigenvalues of this covariance matrix, selecting the K2 largest eigenvalues, and calculating the eigenvectors corresponding to these K2 eigenvalues to form the local principal component basis matrix. Plocal=[Pls(n)|n∈[1..K2]]=[Pls(1),Pls(2),...,Pls(K2)]; where... Pls(n) represents the nth feature vector with dimension K0 arranged in columns.
[0083] By performing steps SA1 to SA7 on each healthy tooth classification set, standard tooth model information corresponding to each healthy tooth classification set can be obtained. This standard tooth model information corresponds to the anatomical location and root canal category of the teeth.
[0084] Before model training, a training sample set needs to be prepared. The training samples include 3D point clouds of teeth and corresponding dental medical description text. In this embodiment, the 3D point clouds of teeth for each training sample come from the aforementioned healthy tooth classification sets and diseased tooth classification sets, respectively. The dental medical description text is generated manually based on the 3D tooth images displayed on the screen according to the corresponding 3D point clouds. The training sample set is divided into a healthy tooth training sample set and a diseased tooth training sample set according to whether the teeth have lesions.
[0085] The model training process is divided into two stages: a healthy tooth sample training stage and a diseased tooth sample training stage. The healthy tooth sample training stage is performed first. After the training process has been executed for a certain number of rounds, or the loss value reaches the preset requirement, the diseased tooth sample training stage begins.
[0086] During the training phase using healthy tooth samples, a set of healthy tooth training samples is used as training data. During training, the loss value is calculated based on the 3D tooth feature map Xspecial output from step SU42 and the 3D tooth points in the training samples.
[0087] During the training phase of the diseased tooth samples, the combined set of training samples from healthy teeth and diseased teeth is used as the training data. During training, the cloud loss value is calculated based on the final output 3D map of the decayed teeth and the 3D points of the teeth in the training samples.
[0088] The loss value can be calculated using the covariance calculation formula.
[0089] In another alternative implementation, the cascade diffusion model and the region adaptive diffusion model can be trained separately. The cascade diffusion model is trained using a combination of training samples from healthy teeth and training samples from diseased teeth, while the region adaptive diffusion model is trained using training samples from diseased teeth.
[0090] Furthermore, those skilled in the art will understand that the input medical description text of dental caries is not limited to teeth with caries, but can also be healthy teeth. For healthy teeth, the aforementioned initialization steps can avoid generating caries feature vectors and determining the coordinates of the caries center, the extent of the lesion area, and the caries deformation weighting table. Therefore, the skipped region adaptive diffusion model execution step is performed, and in the dental caries 3D image construction step, the 3D tooth feature map output in step SU42 is directly used as the final output, thereby directly realizing the text-based image function for teeth.
[0091] Furthermore, it should be noted that the device for generating three-dimensional images of dental caries from text as described above is a virtual device implemented by executing computer program instructions. Its modules correspond one-to-one with the steps in the method for generating three-dimensional images of dental caries from text, and need not be elaborated upon.
Claims
1. A method for generating three-dimensional images of dental caries based on text, characterized in that, It includes the steps of receiving medical description text of dental caries and generating corresponding three-dimensional images of dental caries based on the received medical description text of dental caries; The medical description text of dental caries shall include at least the anatomical location of the tooth and the type of root canal. The step of generating a corresponding three-dimensional image of a carious tooth based on the received medical description text of caries includes: Step SU1: Generate text embedding vectors and root canal structure vectors based on the medical description text of dental caries, and match them with standard tooth model information; the standard tooth model information includes standard tooth 3D point cloud, global principal component deviation mean, global principal component basis matrix, local principal component deviation mean, and local principal component basis matrix; Step SU2: Input the text embedding vector and root canal structure vector into the cascaded diffusion model to obtain the global latent vector and local latent vector; Step SU41: Based on the mean deviation of the global principal components and the basis matrix of the global principal components, perform inverse principal component analysis on the global latent vector to calculate the global characteristic deformation field; and based on the mean deviation of the local principal components and the basis matrix of the local principal components, perform inverse principal component analysis on the local latent vector to calculate the local characteristic deformation field. Step SU42: Superimpose the global feature deformation field and the local feature deformation field onto the standard tooth 3D point cloud according to the point cloud locations to obtain a 3D image of the tooth features. in, The text embedding vector is obtained by segmenting the medical description text of dental caries into words and inputting it into a pre-trained BioBERT model, and then extracting the hidden state of the last layer of the BioBERT model. The root canal structure vector is a vector generated by one-hot encoding of the tooth root canal category; The cascaded diffusion model includes global diffusion model units and local diffusion model units; The global diffusion model unit includes a global conditional feature encoding unit, a global backbone feature encoding unit, a global feature fusion unit, and a global output unit; The local diffusion model unit includes a local conditional feature encoding unit, a local backbone feature encoding unit, a local feature fusion unit, and a local output unit; The global conditional feature encoding unit and the local conditional feature encoding unit: after inputting the text embedding vector and the root canal structure vector into two linear layers respectively, two vectors are obtained. After concatenation, and after linear layer and layer normalization processing, the global conditional feature vector and the local conditional feature vector are obtained respectively. The global backbone feature encoding unit takes the global latent feature vector as input, maps it through a linear layer, concatenates it with the current time step encoding vector, and then compresses it through a linear layer to output the global backbone feature vector. The local backbone feature encoding unit takes the global latent vector and the local latent feature vector as input, maps them through a linear layer, concatenates them with the encoding vector of the current time step, and then compresses them through a linear layer to output the local backbone feature vector. The global feature fusion unit and the local feature fusion unit are each composed of several Transformer blocks connected in series using a multi-head cross-attention mechanism; In the global feature fusion unit, the global backbone feature vector is used as the Q vector of the Transformer block, and the global conditional feature vector is used as the K vector and V vector. In the local feature fusion unit, the local backbone feature vector is used as the Q vector of the Transformer block, and the local conditional feature vector is used as the K vector and V vector. When the global diffusion model unit is executed, the time steps traverse from T1 to 1, and the global backbone feature encoding unit, global feature fusion unit, and global output unit are executed in a loop for T1 rounds accordingly. Initially, the global latent feature vector is randomly generated. In other time steps, the output of the global output unit of the previous time step is used as the global latent feature vector. The global latent vector is the output of the global output unit in the last time step. Where T1 is the total number of time steps of the global diffusion model unit. When the local diffusion model unit is executed, the time steps traverse from T2 to T1, and the local backbone feature encoding unit, local feature fusion unit, and local output unit are executed in a loop for T2 rounds accordingly. Initially, the local latent feature vector is randomly generated. At other time steps, the output of the local output unit of the previous time step is used as the local latent feature vector. The local latent vector is the output of the local output unit at the last time step. Where T2 is the total number of time steps of the local diffusion model unit.
2. The method for generating a three-dimensional image of dental caries based on text according to claim 1, characterized in that, If the tooth described in the medical description text of dental caries has lesions, then a caries feature vector is generated, and the coordinates of the caries center, the extent of the lesion area, and the caries deformation weighting table are determined. The step of generating a corresponding three-dimensional image of the caries based on the received medical description text of the caries further includes: Step SU3: Input the caries feature vector into the region adaptive diffusion model to obtain the deformation field of the lesion region; After step SU42, perform the following steps: Step SU43: Weight the deformation field of the caries region according to the caries deformation weighting table and overlay it with the three-dimensional image of tooth features to obtain a preliminary three-dimensional image of the caries. Step SU44: Smooth and adjust the preliminary 3D model of the caries, and output the final 3D model of the caries. The regional adaptive diffusion model includes a signal fusion unit, an encoding input unit, an encoding / decoding unit, and a decoding output unit; The signal fusion unit takes the caries feature vector as input. The caries feature vector is mapped through two linear layers connected by GELU activation and then added to the current time step encoding vector to form a residual injection vector. The coding input unit takes the caries feature deformation field as input, transposes it, and outputs the caries feature coding deformation field after convolution by the convolutional layer. The encoding / decoding unit includes an encoding unit, a decoding unit, and an intermediate layer; The encoding unit comprises three encoding blocks with different dimensional features arranged in sequence: a first encoding block, a second encoding block, and a third encoding block; wherein the input of the first encoding block is connected to the output of the encoding input unit; the encoding blocks are connected to each other through a channel dimension adaptation layer; The decoding unit comprises three decoding blocks arranged in sequence: a third decoding block, a second decoding block, and a first decoding block. The first, second, and third decoding blocks correspond sequentially to the first, second, and third encoding blocks, respectively, and the dimensional features of the decoding blocks and their corresponding encoding blocks are identical. The input of the third decoding block is connected to the intermediate layer and the output of the third encoding block via a skip connection block. The input of the second decoding block is connected to the outputs of the third decoding block and the second encoding block via a skip connection block. The input of the first decoding block is connected to the outputs of the second decoding block and the first encoding block via a skip connection block. The output of the first decoding block is connected to the decoding output unit. The jump connection block includes a dimension splicing unit and a channel dimension adaptation layer; The dimension splicing unit is used for splicing along the vector dimension; The channel dimension adaptation layer includes a convolutional layer for channel dimension feature adaptation and transformation; The encoding block and decoding block include two residual blocks, wherein the first residual block is output to the second residual block through residual concatenation; The intermediate layer includes two residual blocks connected by a multi-head attention block. The output of the encoding unit is processed sequentially by the first residual block, the multi-head attention block and the second residual block of the intermediate layer and then input to the decoding unit. The residual block includes two convolutional blocks. The residual injection vector is aligned by the number of dimensions and channels, added to the output of the convolutional layer of the previous convolutional block, and then input into the next convolutional block. The convolutional block includes group normalization and convolutional layers arranged in sequence. The input of the residual block is group normalized and then activated by SILU before being input to the convolutional layer, and then output through the convolutional layer. The multi-head attention block adopts a four-head self-attention mechanism; The decoding output unit takes the output of the encoding / decoding unit as input, and after group normalization, SILU activation and convolution of the convolutional layer, it is transposed and output. When the region adaptive diffusion model is executed, the time step traverses from T3 to 1, and the signal fusion unit, encoding input unit, encoding / decoding unit, and decoding output unit cyclically execute T3 rounds accordingly; where T3 is the total number of time steps in the region adaptive diffusion model; initially, when the time step is T3, the caries feature deformation field input to the encoding unit is randomly generated; at other time steps, the caries feature deformation field is the output of the decoding output unit of the previous time step; the output of the decoding output unit at the last time step is the caries region deformation field finally output by the region adaptive diffusion model. Step SU44 includes step SU443; Step SU443: Traverse the points at the edge of the lesion area and readjust their positions according to the following formula: dnew(i)=a*dold(i)+b*davg(i); where, dnew(i) represents the adjusted center distance of the i-th edge point of the lesion area; dold(i) represents the center distance of the i-th edge point of the lesion area before adjustment; davg(i) represents the average center distance between adjacent points of the i-th edge point of the lesion region.
3. The method for generating a three-dimensional image of dental caries based on text according to claim 2, characterized in that, In step SU44, steps SU441 and SU442 are included before step SU443; Step SU441: Traverse the points at the edge of the lesion area, calculate the angle between the point and the outer normal vector of a ring of neighboring points at a distance of 10 units, and if the angle is greater than 90°, shrink the point a certain distance toward the center of the standard tooth three-dimensional point cloud. Step SU442: Traverse the points within the lesion area. If the depression depth of a point is less than dmin, adjust the depression depth of the point to dmin. If the depression depth of a point is greater than dmax, adjust the depression depth of the point to dmax. Here, dmin and dmax are obtained by mapping the lesion depth information. The depression depth refers to the distance difference between the center distance of a point in the point cloud and the center distance of a standard tooth 3D point cloud.
4. The method for generating a three-dimensional image of dental caries based on text according to claim 1, 2, or 3, characterized in that, It also includes the step of cloud computing standard tooth model information based on three-dimensional points of teeth in a healthy tooth classification set, including: Step SA1: Average the 3D point cloud of teeth in the set to obtain a standard 3D point cloud of teeth. Step SA2: Based on the 3D point cloud of teeth in the set and the corresponding standard 3D point cloud of teeth, obtain the global deformation field matrix for each tooth sample in the set. DG=[dg(j)|j∈[1..M]]T=[d(1),d(2),...,d(M)]T; where, DG is the global deformation field matrix; T denotes matrix transpose; M is the number of tooth samples in the set; dg(j) is the vector of the deformation field column arrangement of the j-th tooth sample in the corresponding tooth classification set; dg(j)={dd(j,i)=p(j,i)-pn(i)|i∈[1..K0]}; where, dd(j,i) is the deformation of the i-th contour point in the deformation field of the j-th tooth sample in the set; p(j,i) represents the distance of the i-th contour point of the j-th tooth sample in the set from the coordinate center in three-dimensional polar coordinates; pn(i) represents the distance from the center of the coordinate system to the i-th contour point of the standard tooth 3D point cloud in 3D polar coordinates; Step SA3: Calculate the global principal component deviation mean Mglobal=avg{dg(j)|j∈[1..M]}; where avg represents the mean calculation function; Step SA4: Calculate the covariance matrix of the global deformation field matrix, then calculate the eigenvalues of the covariance matrix, select the K1 eigenvalues with the largest eigenvalues, and calculate the eigenvectors corresponding to these K1 eigenvalues to form the global principal component basis matrix. Step SA5 involves comparing the absolute values of the deformation variables of each contour point within the deformation field dg(j) of the tooth sample, extracting the contour points with the largest deformation variables (KF values in total) to obtain the set of contour point locations with the largest deformation. Then, the sets of contour point locations with the largest deformation variables from each tooth sample deformation field are intersected to obtain the set of contour point locations with common large deformations across all tooth sample deformation fields. Finally, based on the contour points in the set of common large deformation locations, the deformation variables are extracted from the tooth sample deformation field dg(j) to obtain the local deformation field dl(j), and thus the local deformation field matrix is obtained. DL=[dl(j)|j∈[1..M]]T=[d(1),d(2),...,d(M)]T; where, DL is the local deformation field matrix; T denotes matrix transpose; dl(j) represents the local deformation field of the column orientation of the j-th tooth sample in the set. dl(j) = {dl(j,i) | i ∈ [1..K0]}; where, dl(j,i) represents the deformation of the i-th contour point in the local deformation field of the j-th tooth sample in the set. If i∈Scom, then dl(j,i)=dg(j,i), otherwise dl(j,i)=0; Scom represents the set of contour point positions where the deformation fields of all tooth samples have a large deformation. Step SA6: Calculate the mean local principal component deviation Mlocal=avg{dl(j)|j∈[1..M]}; where avg represents the mean calculation function; Step SA7: Calculate the covariance matrix of the local deformation field matrix, then calculate the eigenvalues of the covariance matrix, select the K2 eigenvalues with the largest eigenvalues, and calculate the eigenvectors corresponding to these K2 eigenvalues to form the local principal component basis matrix; The healthy teeth classification set is a collection of tooth point cloud classification information; the tooth point cloud classification information includes tooth anatomical location, tooth root canal category, and tooth three-dimensional point cloud.
5. An apparatus for generating three-dimensional images of dental caries based on text, characterized in that, It includes a module for receiving medical description text of dental caries and a module for generating corresponding three-dimensional images of dental caries based on the received medical description text of dental caries; The medical description text of dental caries shall include at least the anatomical location of the tooth and the type of root canal. The module that generates a corresponding three-dimensional image of dental caries based on the received medical description text of dental caries includes: Module MU1: Generates text embedding vectors and root canal structure vectors based on the medical description text of dental caries, and matches them with standard tooth model information; the standard tooth model information includes standard tooth 3D point cloud, global principal component deviation mean, global principal component basis matrix, local principal component deviation mean, and local principal component basis matrix; Module MU2: Inputs the text embedding vector and root canal structure vector into the cascaded diffusion model to obtain the global latent vector and local latent vector; Module MU41 performs inverse principal component analysis on the global latent vectors based on the mean of the global principal component deviations and the global principal component basis matrix to calculate the global characteristic deformation field. It also performs inverse principal component analysis on the local latent vectors based on the mean of the local principal component deviations and the local principal component basis matrix to calculate the local characteristic deformation field. Module MU42 superimposes the global feature deformation field and the local feature deformation field onto the standard tooth 3D point cloud according to the point cloud to obtain a 3D image of tooth features. in, The text embedding vector is obtained by segmenting the medical description text of dental caries into words and inputting it into a pre-trained BioBERT model, and then extracting the hidden state of the last layer of the BioBERT model. The root canal structure vector is a vector generated by one-hot encoding of the tooth root canal category; The cascaded diffusion model includes global diffusion model units and local diffusion model units; The global diffusion model unit includes a global conditional feature encoding unit, a global backbone feature encoding unit, a global feature fusion unit, and a global output unit; The local diffusion model unit includes a local conditional feature encoding unit, a local backbone feature encoding unit, a local feature fusion unit, and a local output unit; The global conditional feature encoding unit and the local conditional feature encoding unit: after inputting the text embedding vector and the root canal structure vector into two linear layers respectively, two vectors are obtained. After concatenation, and after linear layer and layer normalization processing, the global conditional feature vector and the local conditional feature vector are obtained respectively. The global backbone feature encoding unit takes the global latent feature vector as input, maps it through a linear layer, concatenates it with the current time step encoding vector, and then compresses it through a linear layer to output the global backbone feature vector. The local backbone feature encoding unit takes the global latent vector and the local latent feature vector as input, maps them through a linear layer, concatenates them with the encoding vector of the current time step, and then compresses them through a linear layer to output the local backbone feature vector. The global feature fusion unit and the local feature fusion unit are each composed of several Transformer blocks connected in series using a multi-head cross-attention mechanism; In the global feature fusion unit, the global backbone feature vector is used as the Q vector of the Transformer block, and the global conditional feature vector is used as the K vector and V vector. In the local feature fusion unit, the local backbone feature vector is used as the Q vector of the Transformer block, and the local conditional feature vector is used as the K vector and V vector. When the global diffusion model unit is executed, the time steps traverse from T1 to 1, and the global backbone feature encoding unit, global feature fusion unit, and global output unit are executed in a loop for T1 rounds accordingly. Initially, the global latent feature vector is randomly generated. In other time steps, the output of the global output unit of the previous time step is used as the global latent feature vector. The global latent vector is the output of the global output unit in the last time step. Where T1 is the total number of time steps of the global diffusion model unit. When the local diffusion model unit is executed, the time steps traverse from T2 to T1, and the local backbone feature encoding unit, local feature fusion unit, and local output unit are executed in a loop for T2 rounds accordingly. Initially, the local latent feature vector is randomly generated. At other time steps, the output of the local output unit of the previous time step is used as the local latent feature vector. The local latent vector is the output of the local output unit at the last time step. Where T2 is the total number of time steps of the local diffusion model unit.
6. The apparatus for generating a three-dimensional image of dental caries based on text according to claim 5, characterized in that, If the tooth described in the medical description text of dental caries has lesions, then a caries feature vector is generated, and the coordinates of the caries center, the extent of the lesion area, and the caries deformation weighting table are determined. The module that generates a corresponding three-dimensional image of dental caries based on the received medical description text of dental caries also includes: Module MU3: Inputs the caries feature vector into the region adaptive diffusion model to obtain the deformation field of the lesion region; The following module is executed after module MU42: Module MU43: After weighting the deformation field of the caries region according to the caries deformation weighting table, it is superimposed with the 3D image of tooth features to obtain a preliminary 3D image of the caries. Module MU44: Smooths and adjusts the initial 3D model of tooth decay, and outputs the final 3D model of tooth decay; The regional adaptive diffusion model includes a signal fusion unit, an encoding input unit, an encoding / decoding unit, and a decoding output unit; The signal fusion unit takes the caries feature vector as input. The caries feature vector is mapped through two linear layers connected by GELU activation and then added to the current time step encoding vector to form a residual injection vector. The coding input unit takes the caries feature deformation field as input, transposes it, and outputs the caries feature coding deformation field after convolution by the convolutional layer. The encoding / decoding unit includes an encoding unit, a decoding unit, and an intermediate layer; The encoding unit comprises three encoding blocks with different dimensional features arranged in sequence: a first encoding block, a second encoding block, and a third encoding block; wherein the input of the first encoding block is connected to the output of the encoding input unit; the encoding blocks are connected to each other through a channel dimension adaptation layer; The decoding unit comprises three decoding blocks arranged in sequence: a third decoding block, a second decoding block, and a first decoding block. The first, second, and third decoding blocks correspond sequentially to the first, second, and third encoding blocks, respectively, and the dimensional features of the decoding blocks and their corresponding encoding blocks are identical. The input of the third decoding block is connected to the intermediate layer and the output of the third encoding block via a skip connection block. The input of the second decoding block is connected to the outputs of the third decoding block and the second encoding block via a skip connection block. The input of the first decoding block is connected to the outputs of the second decoding block and the first encoding block via a skip connection block. The output of the first decoding block is connected to the decoding output unit. The jump connection block includes a dimension splicing unit and a channel dimension adaptation layer; The dimension splicing unit is used for splicing along the vector dimension; The channel dimension adaptation layer includes a convolutional layer for channel dimension feature adaptation and transformation; The encoding block and decoding block include two residual blocks, wherein the first residual block is output to the second residual block through residual concatenation; The intermediate layer includes two residual blocks connected by a multi-head attention block. The output of the encoding unit is processed sequentially by the first residual block, the multi-head attention block and the second residual block of the intermediate layer and then input to the decoding unit. The residual block includes two convolutional blocks. The residual injection vector is aligned by the number of dimensions and channels, added to the output of the convolutional layer of the previous convolutional block, and then input into the next convolutional block. The convolutional block includes group normalization and convolutional layers arranged in sequence. The input of the residual block is group normalized and then activated by SILU before being input to the convolutional layer, and then output through the convolutional layer. The multi-head attention block adopts a four-head self-attention mechanism; The decoding output unit takes the output of the encoding / decoding unit as input, and after group normalization, SILU activation and convolution of the convolutional layer, it is transposed and output. When the region adaptive diffusion model is executed, the time step traverses from T3 to 1, and the signal fusion unit, encoding input unit, encoding / decoding unit, and decoding output unit cyclically execute T3 rounds accordingly; where T3 is the total number of time steps in the region adaptive diffusion model; initially, when the time step is T3, the caries feature deformation field input to the encoding unit is randomly generated; at other time steps, the caries feature deformation field is the output of the decoding output unit of the previous time step; the output of the decoding output unit at the last time step is the caries region deformation field finally output by the region adaptive diffusion model. The module MU44 includes module MU443; The module MU443: Traverses the points at the edge of the lesion area and readjusts their positions according to the following formula: dnew(i)=a*dold(i)+b*davg(i); where, dnew(i) represents the adjusted center distance of the i-th edge point of the lesion area; dold(i) represents the center distance of the i-th edge point of the lesion area before adjustment; davg(i) represents the average center distance between adjacent points of the i-th edge point of the lesion region.
7. The apparatus for generating a three-dimensional image of dental caries based on text according to claim 6, characterized in that, The module MU44 also includes modules MU441 and MU442; The module MU441: Traverses the points at the edge of the lesion area, calculates the angle between the point and the outer normal vector of a ring of neighboring points at a distance of 10 units, and if the angle is greater than 90°, shrinks the point a certain distance toward the center of the standard tooth 3D point cloud. The module MU442: Traverses the points within the lesion area. If the depression depth of a point is less than dmin, the depression depth of the point is adjusted to dmin. If the depression depth of a point is greater than dmax, the depression depth of the point is adjusted to dmax. Here, dmin and dmax are obtained by mapping the lesion depth information. The depression depth refers to the distance difference between the center distance of a point in the point cloud and the center distance of a standard tooth 3D point cloud.
8. The apparatus for generating a three-dimensional image of dental caries based on text according to claim 5, 6, or 7, characterized in that, It also includes a module for cloud computing standard tooth model information based on three-dimensional points of teeth in a healthy tooth classification set, including: Module MA1 averages the 3D point cloud of teeth within the set to obtain a standard 3D point cloud of teeth. Module MA2 calculates the global deformation field matrix by combining the 3D point clouds of teeth within the set with the deformation field of each tooth sample within the set, based on the 3D point clouds of teeth within the set and the corresponding standard 3D point clouds of teeth. DG=[dg(j)|j∈[1..M]]T=[d(1),d(2),...,d(M)]T; where, DG is the global deformation field matrix; T denotes matrix transpose; M is the number of tooth samples in the set; dg(j) is the vector of the deformation field column arrangement of the j-th tooth sample in the corresponding tooth classification set; dg(j)={dd(j,i)=p(j,i)-pn(i)|i∈[1..K0]}; where, dd(j,i) is the deformation of the i-th contour point in the deformation field of the j-th tooth sample in the set; p(j,i) represents the distance of the i-th contour point of the j-th tooth sample in the set from the coordinate center in three-dimensional polar coordinates; pn(i) represents the distance from the center of the coordinate system to the i-th contour point of the standard tooth 3D point cloud in 3D polar coordinates; Module MA3 calculates the global principal component deviation mean Mglobal=avg{dg(j)|j∈[1..M]}; where avg represents the mean calculation function; Module MA4 calculates the covariance matrix of the global deformation field matrix, then calculates the eigenvalues of the covariance matrix, selects the K1 largest eigenvalues, and calculates the eigenvectors corresponding to these K1 eigenvalues to form the global principal component basis matrix. Module MA5 extracts the contour points with the largest deformation values in the tooth sample deformation field dg(j) by comparing the absolute values of the deformation values of each contour point. This yields the set of contour point locations with the largest deformation. Then, the intersection of these sets is obtained to identify the common contour point locations with significant deformation across all tooth sample deformation fields. Finally, based on the contour points in this common set, the deformation values are extracted from the tooth sample deformation field dg(j) to obtain the local deformation field dl(j), which in turn yields the local deformation field matrix. DL=[dl(j)|j∈[1..M]]T=[d(1),d(2),...,d(M)]T; where, DL is the local deformation field matrix; T denotes matrix transpose; dl(j) represents the local deformation field of the column orientation of the j-th tooth sample in the set. dl(j) = {dl(j,i) | i ∈ [1..K0]}; where, dl(j,i) represents the deformation of the i-th contour point in the local deformation field of the j-th tooth sample in the set. If i∈Scom, then dl(j,i)=dg(j,i), otherwise dl(j,i)=0; Scom represents the set of contour point positions where the deformation fields of all tooth samples have a large deformation. Module MA6 calculates the mean of the local principal component deviations, Mlocal=avg{dl(j)|j∈[1..M]}; where avg represents the mean calculation function. Module MA7 calculates the covariance matrix of the local deformation field matrix, then calculates the eigenvalues of the covariance matrix, selects the K2 largest eigenvalues, and calculates the eigenvectors corresponding to these K2 eigenvalues to form the local principal component basis matrix. The healthy teeth classification set is a collection of tooth point cloud classification information; the tooth point cloud classification information includes tooth anatomical location, tooth root canal category, and tooth three-dimensional point cloud.
9. A machine-readable medium, characterized in that, The medium stores a set of program instructions that can be loaded and executed by a machine; when the set of program instructions stored in the medium is loaded and executed by a machine, it can realize the method of generating a three-dimensional image of dental caries based on text according to any one of claims 1 to 4.
10. An electronic device comprising a processor and a memory connected together; the memory storing a program instruction set; characterized in that, When the program instruction set stored in the memory is executed by the processor, the device is able to implement the method for generating a three-dimensional image of dental caries from text according to any one of claims 1 to 4.