An artificial intelligence-based scar area calculation method and system

By employing an AI-based scar area calculation method, which utilizes an image segmentation model and a preset scale reference object, the scar area is automatically identified and measured. This solves the problems of subjectivity and low efficiency in traditional measurement methods, and achieves high-precision, automated measurement and data support for scar area.

CN122156090APending Publication Date: 2026-06-05SHANGHAI SIXTH PEOPLES HOSPITAL

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI SIXTH PEOPLES HOSPITAL
Filing Date
2026-02-06
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In existing scar treatment protocols, the measurement of scar surface area relies on manual measurement and visual estimation methods, which suffer from high subjectivity, low efficiency, and poor accuracy, making it difficult to achieve personalized dressing preparation and precise treatment cost calculation.

Method used

An AI-based scar area calculation method is adopted, which automatically identifies scar regions through an image segmentation model and calculates scar area by combining a preset scale reference object. The method includes image preprocessing, semantic segmentation, mask image extraction and pixel contour calculation. By using TransUNet network and color threshold segmentation technology, combined with morphological operations and scaling, the objective and automated measurement of scar area is achieved.

Benefits of technology

It achieves high-precision, automated identification and area measurement of scar areas, improving the objectivity and repeatability of measurements, providing a reliable data foundation, and laying the groundwork for personalized dressing customization and precise treatment cost calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122156090A_ABST
    Figure CN122156090A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of intelligent medical image processing and skin diagnosis and treatment, and particularly relates to a scar area calculation method and system based on artificial intelligence, comprising obtaining an original image containing a scar and a scale reference object; image preprocessing and enhancement; obtaining mask images of the scar and the reference object respectively through a trained image segmentation model and image processing technology; extracting the pixel contours of the two based on the masks; and calculating the actual physical area of the scar in combination with the known size of the reference object. The present application uses AI technology to realize automatic and accurate identification and contour extraction of the scar, and converts pixel data into real area through reference object calibration, thereby overcoming the subjective and inefficient defects of traditional manual measurement, significantly improving the objectivity, repeatability and efficiency of measurement, and providing a reliable basis for personalized dressing customization and accurate treatment cost accounting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent medical image processing and skin diagnosis and treatment technology, specifically to an artificial intelligence-based method and system for calculating scar area. Background Technology

[0002] Scars, especially keloids and pockmarks, are pathological products formed by the abnormal deposition and remodeling of collagen during the healing process following skin injury. Their clinical features include persistent localized tissue elevation, color changes, and abnormal texture, often accompanied by itching, pain, and even functional impairment. Compared to ordinary superficial scars, these pathological scars usually do not resolve spontaneously, severely impacting the patient's appearance and quality of life. Long-term presence may lead to chronic ulcers, and in rare cases, even malignant transformation, posing a potential threat to the patient's life and health.

[0003] Scar treatment is a complex and long-term process, with commonly used clinical methods including surgical excision, laser therapy, radiation therapy, pressure therapy, and medicated dressings. Among these, medicated dressings are widely used due to their non-invasive nature and relatively simple operation. In this process, two key clinical aspects directly determine the treatment's effectiveness and efficiency: first, the precise definition of the scar treatment area (i.e., the scar surface area); and second, the personalized dressing customization and treatment cost calculation based on this precise area.

[0004] Currently, the definition and measurement of scar surface area in clinical practice mainly relies on two traditional methods. One method involves doctors or therapists manually measuring and sketching outlines using physical measuring tools such as rulers. This method heavily depends on the operator's experience and skill level, and is not only cumbersome and inefficient, but also makes it difficult to guarantee the objectivity and repeatability of measurement results for irregular or poorly defined scars. Consequently, the shape of the dressing used often fails to perfectly fit the scar edges, leading to incomplete treatment coverage or wasted dressing.

[0005] Another method involves taking photos of the scar with a smartphone or regular digital camera, and then having a doctor visually assess or make simple markings on the photos based on their observation and experience. While this method reduces the complexity of the procedure to some extent, it still cannot escape the influence of subjective judgment. Its accuracy is limited by various factors such as shooting angle, lighting conditions, and image resolution, and it also cannot achieve precise quantitative measurement.

[0006] The aforementioned reasons have led to significant challenges in existing scar treatment programs in two key areas: personalized dressing preparation and precise treatment cost accounting. These challenges stem from the lack of objective and efficient methods for quantifying surface area, making it difficult to meet the clinical needs of precision medicine and refined management. Summary of the Invention

[0007] To address the above technical problems, this invention provides a technical solution for a scar area calculation method and system based on artificial intelligence.

[0008] The technical problem solved by this invention can be achieved by the following technical solutions: An artificial intelligence-based method for calculating scar area includes: Step S1: Obtain the patient's original scar image, which includes the scar area and a preset scale reference area; Step S2: Perform preprocessing on the original scar image to generate an enhanced scar image; Step S3: Semantic segmentation is performed on the enhanced scar image using the trained image segmentation model to obtain a first mask image identifying the scar region. The enhanced scar image is then processed using image processing techniques to obtain a second mask image identifying the scale reference object region. Step S4: Based on the first mask image and the second mask image, extract the first pixel contour of the scar region and the second pixel contour of the scale reference region, respectively. Step S5: Based on the first pixel contour and the second pixel contour, and in combination with the known geometric dimensions of the scale reference area, calculate the physical area of ​​the scar region to obtain the patient's scar area.

[0009] Preferably, step S2 includes: Step S21: Perform a center cropping operation on the original scar image to generate a cropped image, wherein the cropped image focuses on the scar region and the scale reference area; Step S22: Perform image sharpening operation on the cropped image to generate the enhanced scar image.

[0010] Preferably, in step S3, the image segmentation model is a TransUNet network model based on a convolutional neural network encoder and a Transformer encoder, and the TransUNet network model integrates channel attention mechanism and spatial attention mechanism; The image processing technique is color threshold segmentation.

[0011] Preferably, the training process of the image segmentation model is optimized using a binary classification cross-entropy loss function.

[0012] Preferably, step S4 includes: Step S41: Perform morphological erosion and dilation operations on the first mask image and the second mask image respectively; Step S42: Extract the boundary pixel coordinates of the first mask image and the second mask image after morphological operation to obtain the first pixel contour and the second pixel contour.

[0013] Preferably, step S5 includes: Step S51: Calculate the first pixel area of ​​the scar region based on the first pixel contour; Step S52: Calculate the second pixel area of ​​the scale reference area based on the second pixel contour; Step S53: Calculate and generate the patient's scar area based on the area of ​​the first pixel, the area of ​​the second pixel, and the geometric dimensions of the scale reference area. The specific calculation formula is as follows:

[0014] in, The area of ​​the patient's scar. The area of ​​the first pixel. The area of ​​the second pixel. The geometric dimensions of the scale reference area are given.

[0015] Preferably, it further includes: Step S6: Draw the first pixel contour and the second pixel contour on the original scar image or the enhanced scar image to generate a contour overlay image.

[0016] Preferably, the method further includes step S7, which predicts the scar repair effect on the patient, wherein step S7 includes: Step S71: Obtain a sequence of scar images containing the scar area and the scale reference area for the patient at n stages before and after treatment, where n is a positive integer; Step S72: Normalize the scar regions contained in each image in the scar image sequence to a uniform physical scale; Step S73: Input the normalized scar image sequence into the trained efficacy prediction model to obtain the predicted scar efficacy status at the (n+1)th stage after the patient's treatment.

[0017] An artificial intelligence-based scar area calculation system, used to implement the artificial intelligence-based scar area calculation method described above, includes: The image acquisition module is used to acquire the patient's original scar image, which includes the scar area and a preset scale reference area; An image preprocessing module, connected to the image acquisition module, is used to preprocess the original scar image to generate an enhanced scar image; The image segmentation module, connected to the image preprocessing module, is used to perform semantic segmentation on the enhanced scar image using a trained image segmentation model to obtain a first mask image identifying the scar region, and to process the enhanced scar image using image processing techniques to obtain a second mask image identifying the scale reference object region. The contour acquisition module, connected to the image segmentation module, is used to extract the first pixel contour of the scar region and the second pixel contour of the scale reference area based on the first mask image and the second mask image, respectively. An area calculation module, connected to the contour acquisition module, is used to calculate the physical area of ​​the scar region based on the first pixel contour and the second pixel contour, combined with the known geometric dimensions of the scale reference area, so as to obtain the patient's scar area.

[0018] Preferably, it further includes: The report generation and display module is connected to the area calculation module and is used to present the contour overlay image and the patient's scar area on the display interface, and generate an analysis report containing quantitative data based on the contour overlay image and the patient's scar area. The image correction module, connected to the contour acquisition module, is used to interactively modify the contour of the first pixel based on the adjustment command input by the user, and send the modified contour data to the area calculation module to update the scar area calculation result.

[0019] Beneficial effects: By introducing artificial intelligence image segmentation technology, this invention achieves automated and high-precision identification and contour extraction of scar areas. Combined with calibration of a preset scale reference object, the pixel contour is accurately converted into physical area, thereby overcoming the problems of strong subjectivity and low efficiency of traditional manual measurement. It significantly improves the objectivity, repeatability and calculation efficiency of scar surface area measurement, and provides a reliable data foundation for subsequent personalized dressing customization and precise treatment cost calculation. Attached Figure Description

[0020] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a diagram of the image segmentation model architecture of the present invention; Figure 3 This is a schematic diagram of the multi-stage feature extraction based on the image segmentation model of the present invention; Figure 4 This is a flowchart of the pixel contour extraction process of the present invention; Figure 5 This is a flowchart of the scar area calculation method of the present invention; Figure 6 This is the system architecture diagram of the present invention. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.

[0023] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the scope of the invention.

[0024] Reference Figure 1 This invention provides an artificial intelligence-based method for calculating scar area, comprising: Step S1: Obtain the patient's original scar image, which includes the scar area and a preset scale reference area; Step S2: Perform preprocessing on the original scar image to generate an enhanced scar image; Step S3: Semantic segmentation is performed on the enhanced scar image using the trained image segmentation model to obtain a first mask image identifying the scar region. The enhanced scar image is then processed using image processing techniques to obtain a second mask image identifying the scale reference object region. Step S4: Based on the first mask image and the second mask image, extract the first pixel contour of the scar region and the second pixel contour of the scale reference region, respectively. Step S5: Based on the first pixel contour and the second pixel contour, and in combination with the known geometric dimensions of the scale reference area, calculate the physical area of ​​the scar region to obtain the patient's scar area.

[0025] Specifically, in this embodiment of the invention, in response to the problems of traditional measurement methods being heavily reliant on manual labor, highly subjective, and having low accuracy in measuring irregular scars, a deep learning-based image segmentation model is introduced to automatically identify scar boundaries. Spatial proportion calibration is performed by combining a preset high-contrast, regularly shaped, and known physical area scale reference object (such as a standard color chart, a marker sticker of a specific size, etc.). This avoids the random errors of manual marking and the scale distortion caused by perspective distortion during shooting, and achieves objective, automated, and sub-pixel-level accurate delineation of the boundaries of scars of any complex shape, as well as unambiguously converting the image pixel area into the real-world physical area.

[0026] Specifically, in practical applications, this method can be integrated into a mobile app or clinical workstation software. The operator simply needs to use a mobile phone camera or other mobile device, at a standard shooting distance, to ensure that the scale reference object pasted or placed next to the affected area and the scar to be measured are on the same focal plane and clearly visible in the lens simultaneously, thus completing image acquisition.

[0027] Subsequently, the images can be automatically transmitted to the back-end server via wireless networks (such as Wi-Fi, 4G / 5G, etc.) or the hospital's intranet and securely stored in the corresponding patient image database.

[0028] In a preferred embodiment of the present invention, step S2 includes: Step S21: Perform a center cropping operation on the original scar image to generate a cropped image, wherein the cropped image focuses on the scar region and the scale reference area; Step S22: Perform image sharpening operation on the cropped image to generate the enhanced scar image.

[0029] Specifically, in order to eliminate interference from irrelevant information in the background of the original image, improve the effective resolution of the region of interest, and enhance the boundary features of the scar, this embodiment of the invention optimizes the image quality through a preprocessing flow of cropping followed by sharpening, laying the foundation for subsequent accurate segmentation.

[0030] Specifically, firstly, object detection or interactive bounding box selection is preferred to automatically or assistedly determine the smallest bounding rectangle region containing the scar and the scale reference object, and then cropping is performed with this region as the center, thereby removing redundant background skin, clothing or other environmental information. This allows computing resources to be fully concentrated on the key region, reducing noise interference and computational load during subsequent model segmentation while maintaining the original high-resolution details.

[0031] Next, image sharpening operations are applied to the cropped image, such as using the Laplacian operator and unsharpened masks. Sharpening enhances the high-frequency components of edges and details in the image, making the color and texture contrast between scars and normal skin more distinct, and the boundary lines clearer. This effectively compensates for the boundary blurring caused by uneven lighting or small differences in pigmentation within the scar itself, thus significantly improving the confidence and accuracy of subsequent semantic segmentation models in edge pixel classification.

[0032] In this way, the precise cropping and sharpening of the image through preprocessing not only improves the signal-to-noise ratio of the image data and enhances the visual features of the scar area, but also simplifies the processing complexity of the subsequent segmentation model, providing a high-quality image foundation for the accurate quantitative measurement of scar area.

[0033] In a preferred embodiment of the present invention, in step S3, the image segmentation model is a TransUNet network model based on a convolutional neural network and a Transformer encoder, and the TransUNet network model integrates a channel attention mechanism and a spatial attention mechanism. The image processing technique is color threshold segmentation.

[0034] Specifically, in order to achieve high-precision and automated segmentation of complex and irregular scar regions and overcome the limitations of traditional single convolutional neural network (CNN) models in long-range dependency modeling, referencing Figure 2 In this embodiment of the invention, a TransUNet hybrid coding architecture that combines the global modeling capabilities of Transformer with the local feature extraction advantages of CNN is adopted. This hybrid coding architecture introduces the self-attention mechanism of Transformer into the U-shaped segmentation network (U-Net), which effectively models the global contextual information of the scar region while preserving the low-level spatial details of the image, thereby significantly improving the accuracy and consistency of the segmentation boundary.

[0035] Specifically, refer to Figure 2 The hybrid encoding architecture of the TransUNet network model mainly consists of an encoder, a decoder, and a skip connection, and integrates a convolutional block attention module (CBAM).

[0036] Accordingly, the encoder employs a two-stage hybrid design. The first stage is a shallow feature extractor based on a convolutional neural network (CNN). Through a series of convolutional layers and downsampling operations, it progressively generates multi-scale feature maps, such as (16, H, W), (64, H / 2, W / 2), and (128, H / 4, W / 4). These feature maps retain rich local details and spatial information.

[0037] The second stage of the encoder is the Transformer Encoder. It reshapes the deep feature maps extracted by the CNN (e.g., (128, H / 4, W / 4)) and projects them linearly into a series of image patch embeddings, forming an embedded sequence. This sequence is then fed into a stack of Transformer layers (e.g., n=12). Each Transformer layer utilizes multi-head self-attention and a multilayer perceptron (MLP) to establish long-range dependencies across the entire image, thereby capturing global contextual information about the scar region.

[0038] The decoder employs a symmetrical U-shaped structure. It receives global contextual features from the Transformer encoder (reconstructed into 2D feature maps) and feature maps from different scales of the encoder's CNN stage (provided via skip connections). The decoder progressively restores the spatial resolution of the feature maps through an upsampling operation. During upsampling, feature concatenation fuses the upsampled deep semantic features with the corresponding scale shallow detail features introduced by skip connections along the channel dimension to accurately locate boundaries.

[0039] Next, to enhance the model's ability to focus on key scar features, this embodiment integrates a Convolutional Block Attention (CBAM) module on the skip connection path. This module sequentially comprises a Channel Attention Module and a Spatial Attention Module. The Channel Attention Module adaptively recalibrates the weights of feature channels, highlighting feature channels related to the scar region; the Spatial Attention Module generates a spatial weight map, emphasizing key spatial locations in the image related to the scar. Both work synergistically on the features transmitted through the skip connections, making the fused features more discriminative.

[0040] Finally, the high-resolution feature map output by the decoder is passed through a segmentation head (usually a 1x1 convolutional layer) to generate a probability map of each pixel belonging to the scar region or the background, thus completing the end-to-end automatic segmentation.

[0041] Furthermore, for the identification of scale reference object regions, given that they usually have regular shapes and distinct, known colors (such as specific color blocks on a standard color chart), the color threshold segmentation technique is preferably adopted in this embodiment of the invention. This method is based on existing image data, and by analyzing the distribution of the reference object in the color space (such as RGB or HSV), it adjusts and determines the optimal color threshold range multiple times, thereby quickly and accurately separating the reference object region from the image and generating a clearly marked second mask image.

[0042] In addition to the color thresholding method mentioned above, shape template matching, edge detection (such as the Canny operator), or other classic image segmentation techniques can be used to obtain masks of scale reference regions. These methods usually have robust and efficient segmentation performance for objects with high contrast and regular geometric shapes.

[0043] As can be seen, the TransUNet network is responsible for handling complex and textured scar segmentation tasks, while the efficient and stable color thresholding segmentation technique is specifically used to extract scale reference objects with known features; the two work together to provide reliable and automated region mask input for subsequent accurate area calculation.

[0044] As a preferred embodiment of the present invention, refer to Figure 3 The training process of the image segmentation model is as follows: First, a high-quality scar image dataset was formed by extensively collecting and labeling patient scar images of different types, locations, and shapes. Each image in this dataset contains a clear scar area and a predefined scale reference, thus constructing a dataset for model training.

[0045] Secondly, an improved TransUNet network architecture is adopted as the core model. During the model training process, not only are the parameters of all convolutional layers in the TransUNet downsampling path learned, but also the embedded 12-layer Transformer self-attention mechanism enables the model to fully capture the local texture details and high-level semantic features of the scar region.

[0046] Then, to further enhance the model's ability to represent scar features and the accuracy of efficacy prediction, deformable convolution and bidirectional long short-term memory network modules are introduced on the basis of TransUNet. Two layers of deformable convolution (2XDCNM) are used to adaptively extract and enrich the irregular morphological features of scars. Then, the bidirectional LSTM module is used to model the spatial dependency between feature sequences, thereby learning the spatial context information of scars at each stage of the recovery process, and finally outputting the scar region prediction results for each stage.

[0047] Furthermore, TransUNet integrates channel attention and spatial attention mechanisms to optimize feature focusing. The channel attention mechanism performs global max pooling and average pooling in the width and height directions of the input feature map, respectively. The results are then processed by a shared multilayer perceptron, followed by element-wise summation and sigmoid activation to generate a channel attention weight map, which is then used to recalibrate the input features by channel. The spatial attention mechanism takes the features output by the channel attention as input, performs global max pooling and average pooling in the channel dimension, merges them, and then generates a spatial attention weight map through dimensionality reduction by convolutional layers and sigmoid activation, ultimately performing spatial adaptive enhancement of the features.

[0048] Through the above training strategy, the model can simultaneously integrate local details, global semantics, and spatial sequence information, thereby achieving high-precision and robust segmentation of scar areas and providing reliable predictive basis for subsequent efficacy evaluation.

[0049] In a preferred embodiment of the present invention, the training process of the image segmentation model is optimized using a binary classification cross-entropy loss function.

[0050] Specifically, since scar areas typically occupy a small proportion of the overall image, there is an imbalance in the class distribution between the foreground (scar) and the background (normal skin and other parts). To address this class imbalance and improve the stability of the training process, this embodiment of the invention uses binary cross entropy as the model's loss function. This loss function calculates the logarithmic difference between the predicted probability and the true label pixel by pixel, effectively guiding the model to focus on the accurate identification of sparse positive samples (scar areas). The specific calculation formula is as follows:

[0051] in, This represents the predicted output of the nth sample compared to its true label. The error between them, where N represents the total number of samples, This represents the probability that the model predicts the nth sample to be a positive example (i.e., a scar area). This represents the true label of the nth sample (e.g., 1 for the scar area and 0 for the background).

[0052] By optimizing this loss function, the model can learn the feature differences between scars and the background more evenly during training, effectively mitigating the prediction bias caused by class imbalance, thereby improving the segmentation accuracy and robustness of scar regions, especially their blurred or irregular boundaries.

[0053] As a preferred embodiment of the present invention, refer to Figure 4 Step S4 includes: Step S41: Perform morphological erosion and dilation operations on the first mask image and the second mask image respectively; Step S42: Extract the boundary pixel coordinates of the first mask image and the second mask image after morphological operation to obtain the first pixel contour and the second pixel contour.

[0054] Specifically, in order to eliminate artifacts (such as isolated scattered points or internal micro-holes) caused by image noise or small errors in the segmentation process, and to smooth the region boundaries to obtain more accurate and coherent contour lines, thereby providing a basis for subsequent scar size parameters (such as diameter and transverse diameter) calculations, in this embodiment of the invention, morphological image processing techniques are applied to the first and second mask images obtained from the segmentation, respectively, and erosion and dilation operations are performed sequentially to fill any possible internal micro-holes and smooth their irregular boundaries, thereby purifying the mask area and laying a solid foundation for subsequent boundary extraction and size measurement.

[0055] Specifically, in actual operation, for the second mask image (i.e., the scale reference area), it is preferable to use a regular geometric shape such as a circle or square with a known diameter as the scale reference. In this embodiment, a dot with a diameter of 1 cm is used as an example, but the size of the reference is not limited in actual use.

[0056] After performing morphological processing on the dot to smooth its edges, topological analysis of the binary image is performed to accurately determine the coordinates of all continuous pixels on its outer boundary, thereby obtaining a clear and closed second pixel outline of the reference object at this scale. This outline will provide an accurate pixel reference for subsequent physical scale conversion.

[0057] Next, for the first mask image (i.e., the scar region), the coordinates of the outer boundary pixels of the processed binary scar region are extracted to form the first pixel contour. Based on the set of coordinate points of this contour, the approximate circumscribed size of each scar in the image pixel coordinate system can be further calculated, specifically including the horizontal diameter h and the diameter r of the scar in the image pixel coordinate system. The specific calculation formula is as follows:

[0058] in, and These represent the maximum and minimum ordinate values ​​of all pixels in the scar region. and These are the maximum and minimum x-coordinates of all pixels in the scar region, respectively. Although these size parameters are not directly used for the final area calculation, they can provide auxiliary quantitative indicators for the morphological evaluation of scars.

[0059] In this way, through morphological post-processing and boundary coordinate extraction, the system can obtain smooth, complete and accurate pixel-level contour representations of the two regions, the scar and the scale reference object, which fully prepares for the next step of converting pixel information into area measurements in the real physical world.

[0060] As a preferred embodiment of the present invention, refer to Figure 5 Step S5 includes: Step S51: Calculate the first pixel area of ​​the scar region based on the first pixel contour; Step S52: Calculate the second pixel area of ​​the scale reference area based on the second pixel contour; Step S53: Calculate and generate the patient's scar area based on the area of ​​the first pixel, the area of ​​the second pixel, and the geometric dimensions of the scale reference area.

[0061] Specifically, in order to accurately convert the pixel contour information in the image into the actual physical area and eliminate the perspective distortion caused by factors such as shooting angle and distance, in this embodiment of the invention, based on the extracted pixel contour data, a method combining contour integration and proportional conversion is adopted to achieve accurate measurement of the true area of ​​the scar region.

[0062] Specifically, firstly, for the extracted first pixel contour (i.e., scar contour), Green's formula is preferably used to calculate the pixel area. Green's formula transforms the area integral into the boundary curve integral, and its specific expression is as follows:

[0063] Where D represents the scar region in the image pixel coordinate system, L is the positive boundary curve of region D (corresponding to the extracted first pixel contour), and P and Q are continuous scalar functions defined on region D and its boundary L, whose partial derivatives satisfy the continuity condition. In actual discrete pixel point calculation, by traversing the contour point coordinates and accumulating them, the area of ​​the first pixel enclosed by the scar region can be calculated efficiently and accurately.

[0064] Next, for the second pixel outline (i.e. the scale reference object outline), since the scale reference object is a 1 cm circular reference patch, the area of ​​the second pixel can be obtained by using the circular area formula.

[0065] Then, based on the pixel area ratio between the scar and the benchmark in the image, and combined with the known physical area of ​​the benchmark, the actual physical area of ​​the scar is calculated. The specific calculation formula is as follows:

[0066]

[0067] in, The area of ​​the patient's scar. The area of ​​the first pixel. The area of ​​the second pixel. The geometric dimensions of the reference area are given. The diameter of the reference area (i.e., the dot) is given.

[0068] Through the above pixel area calculation and ratio conversion process, the system can output the physical area of ​​the scar with high precision and robustness without relying on the absolute scale of the image, but only by using the relative reference of the reference object in the image. This provides objective and quantitative key data for subsequent personalized dressing customization and treatment evaluation.

[0069] As a preferred embodiment of the present invention, the method for calculating the area of ​​pathological scars further includes: Step S6: Draw the first pixel contour and the second pixel contour on the original scar image or the enhanced scar image to generate a contour overlay image.

[0070] Specifically, in order to provide doctors or patients with intuitive and reliable visual feedback on segmentation and measurement results, and to provide precise graphical basis for further personalized dressing shape design and treatment planning, reference is made to... Figure 1 In this embodiment of the invention, after the area calculation is completed, the system will automatically overlay the extracted scar contour (i.e., the first pixel contour) and the scale reference object contour (i.e., the second pixel contour) onto the original or enhanced scar image with high contrast colors (such as red and green) to generate a contour overlay image.

[0071] The overlay image clearly shows the degree of agreement between the boundaries of the regions automatically identified by the algorithm and the actual visual content, making it easy for operators to verify the results and make necessary corrections. At the same time, the overlay image can be directly used to guide the personalized cutting and preparation of dressings, ensuring that the shape of the dressing is highly matched with the actual morphology of the scar, thereby achieving precise coverage, optimizing treatment effects and reducing material waste.

[0072] In a preferred embodiment of the present invention, the method for calculating the area of ​​pathological scars further includes step S7, which predicts the scar repair effect for the patient. Step S7 includes: Step S71: Obtain a sequence of scar images containing the scar area and the scale reference area for the patient at n stages before and after treatment, where n is a positive integer; Step S72: Normalize the scar regions contained in each image in the scar image sequence to a uniform physical scale; Step S73: Input the normalized scar image sequence into the trained efficacy prediction model to obtain the predicted scar efficacy status at the (n+1)th stage after the patient's treatment.

[0073] Specifically, in order to achieve dynamic evaluation of the scar treatment process and prospective prediction of efficacy, and to provide quantitative basis for clinical adjustment of treatment plans, reference is made to... Figure 1 In this embodiment of the invention, the function of predicting scar repair effect based on time-series images is further extended, namely step S7. Step S7 uses scar images of the same patient at different treatment time points to learn the evolution law of scar morphology through a deep learning model, thereby predicting its subsequent recovery status.

[0074] In a typical application scenario of this invention, n=4 is often used, that is, to obtain the scar image sequence of the same patient in the pre-treatment stage (baseline T0) and four consecutive follow-up stages (T1, T2, T3, T4) after treatment, so as to train and predict the model and output the scar efficacy status assessment at each stage.

[0075] It should be noted that the specific value of the number of stages n can be flexibly set according to the actual clinical prediction needs, and is not limited to the above example.

[0076] Specifically, the process of effect prediction is as follows: First, a scar image sequence is acquired from the patient at n consecutive stages before and after treatment (for example, n=4, which includes five time points: T0 before treatment and T1, T2, T3, and T4 after treatment). For each image in the sequence, the pixel ratio of the scar to the scale reference object is calculated using the aforementioned steps S1 to S4. Based on this ratio, the scar image and the corresponding scar mask image are scaled to a uniform real physical scale to eliminate the size effect caused by the difference in shooting distance.

[0077] Subsequently, based on the mask image, the geometric moment algorithm is used to calculate the centroid of the connected region of the scar, which is used as the center of the scar region. The scar image is then cropped into images of uniform size using this center, thus completing the data preprocessing and ensuring the spatial consistency of the input data.

[0078] Furthermore, referring to Figure 3 The training process for the efficacy prediction model is as follows: First, the preprocessed time-series images are input into the downsampling encoding part of the TransUNet network, and then pass through all convolutional layers and 12 layers of Transformer self-attention mechanism to extract sequence feature vectors rich in global context information. These sequence feature vectors are then reshaped into two-dimensional feature maps, and then pass through a deformable convolution module consisting of two 3x3 deformable convolutional layers, batch normalization, and ReLU activation function to adaptively learn and enhance the morphological change features of scars.

[0079] Next, global max pooling of the spatial dimension is performed on the feature map to obtain a one-dimensional feature vector representing the scar state at each stage.

[0080] Finally, the feature vectors of the same patient at all time points are input into the bidirectional long short-term memory network module in chronological order. The BiLSTM model is used to model the dynamic evolution dependency of scar status in the time dimension and output the prediction of scar treatment status at each stage (especially the future stage).

[0081] Through the above steps, this invention not only achieves static and accurate measurement of scar area, but also dynamically predicts scar repair trends and efficacy by analyzing multi-temporal image data, thereby providing doctors with intelligent decision support throughout the entire cycle from diagnosis and treatment to evaluation.

[0082] In a preferred embodiment of the present invention, after the contour overlay image is generated in step S6, the visualization result containing the scar shape and its calculated area is displayed in real time on the screen of a computer or mobile device.

[0083] Specifically, to enable users (including doctors and patients) to intuitively and quickly understand the quantitative assessment results of scars and formulate subsequent treatment plans based on objective data, in this embodiment of the invention, the system integrates the overlay image of the scar contour with the calculated physical area of ​​the scar and presents it clearly on the interactive interface, such as a computer screen or mobile phone screen. The displayed content includes, but is not limited to: an overlay image of the scar contour with automatically recognized boundaries, area values ​​(usually in square centimeters), and key morphological parameters (such as the size of the circumscribed rectangle).

[0084] Furthermore, based on the shape and area information generated above, a structured user scar analysis report can be automatically or on demand generated. This user scar analysis report can include before and after treatment comparison images, area change curves, morphological feature descriptions, and treatment suggestion summaries, and can be output in the form of electronic documents or printed copies.

[0085] Through the aforementioned display and report generation functions, this embodiment of the invention not only provides high-precision measurement data, but also visualizes and documents the results, greatly improving the efficiency of clinical communication and the accuracy of diagnosis and treatment decisions. At the same time, it provides patients with easy-to-understand feedback on treatment progress, thereby optimizing the overall treatment experience and management process.

[0086] As a preferred embodiment of the present invention, the method for calculating the area of ​​pathological scars is not only applicable to the application treatment of scars and keloids, but can also be extended to other skin lesions that require application intervention, such as hypertrophic scars, hemangiomas and other types of proliferative or vascular skin lesions.

[0087] It is evident that the application of this method is not limited to specific diseases, but is widely applicable to all clinical scenarios of skin lesions that require precise area measurement to guide personalized dressing preparation and efficacy evaluation.

[0088] Reference Figure 6 The present invention also provides an artificial intelligence-based scar area calculation system for implementing the artificial intelligence-based scar area calculation method described above, comprising: The image acquisition module 100 is used to acquire the patient's original scar image, which includes the scar area and a preset scale reference area. The image preprocessing module 200, connected to the image acquisition module 100, is used to perform preprocessing operations on the original scar image to generate an enhanced scar image; The image segmentation module 300, connected to the image preprocessing module 200, is used to perform semantic segmentation on the enhanced scar image using a trained image segmentation model to obtain a first mask image identifying the scar region, and to process the enhanced scar image using image processing technology to obtain a second mask image identifying the scale reference object region. The contour acquisition module 400 is connected to the image segmentation module 300 and is used to extract the first pixel contour of the scar region and the second pixel contour of the scale reference object region based on the first mask image and the second mask image, respectively. The area calculation module 500, connected to the contour acquisition module 400, is used to calculate the physical area of ​​the scar region based on the first pixel contour and the second pixel contour, and in combination with the known geometric dimensions of the scale reference area, so as to obtain the patient's scar area.

[0089] In a preferred embodiment of the present invention, the pathological scar area calculation system further includes: The report generation and display module 600 is connected to the area calculation module 500 and is used to present the contour overlay image and the patient's scar area on the display interface, and generate an analysis report containing quantitative data based on the contour overlay image and the patient's scar area. The image correction module 700, connected to the contour acquisition module 400, is used to interactively modify the contour of the first pixel based on the adjustment command input by the user, and send the modified contour data to the area calculation module 500 to update the scar area calculation result.

[0090] Specifically, due to the complex and diverse morphology of scars and the potential for ambiguous boundaries in clinical practice, fully automated segmentation results sometimes require fine-tuning based on the doctor's experience. Furthermore, treatment decisions need to be supported by intuitive and reliable visual reports for reference. Figure 6 In this embodiment of the invention, the system also integrates a report generation and display module 600 and an image correction module 700.

[0091] Accordingly, the report generation and display module 600 integrates the automatically generated contour overlay image, the calculated scar area, and other relevant quantitative indicators (such as transverse diameter, diameter, etc.) into a structured analysis report, which is clearly presented on the computer or mobile device screen, making it easy for doctors to quickly assess the data.

[0092] The image correction module 700 provides a visual interactive interface based on web or mobile clients, allowing doctors to manually adjust the automatically extracted first pixel contour (such as adding or deleting contour points, smoothing local boundaries) based on their clinical experience. The system recalculates the area in real time based on the corrected contour, thereby integrating expert knowledge on the basis of automation and further improving the accuracy of personalized treatment.

[0093] In a preferred embodiment of the present invention, the pathological scar area calculation system further includes: The efficacy prediction module 800 is connected to the image segmentation module 300 and is used to acquire scar image sequences of patients at multiple stages before and after treatment, and predict the evolution trend of scar efficacy based on the normalized sequence images.

[0094] Specifically, in order to achieve dynamic monitoring of the treatment process and prospective efficacy evaluation, and to assist clinicians in developing and adjusting treatment plans, refer to Figure 6In this embodiment of the invention, the system further integrates an efficacy prediction module 800. This efficacy prediction module 800 receives standardized scar image sequences of the same patient at baseline before treatment and at multiple follow-up time points. First, it performs scale normalization and region alignment preprocessing on the images at each time point. Then, it uses a pre-trained temporal deep learning model to analyze the changing patterns of scar morphology in the time dimension. Finally, it outputs the prediction results of the future efficacy status, providing doctors with full-cycle decision support from static measurement to dynamic prediction.

[0095] In a preferred embodiment of the present invention, the pathological scar area calculation system further includes: The model optimization module 900 connects the image correction module 700 and the image segmentation module 300. It is used to periodically retrain and optimize the image segmentation model based on the expert correction data accumulated by the image correction module 700, so as to continuously improve the automatic segmentation accuracy and stability of the system.

[0096] Specifically, to ensure the system can continuously learn and utilize expert-corrected data generated in clinical practice, thereby achieving autonomous evolution and iterative upgrades of algorithm performance, refer to Figure 6 In this embodiment of the invention, the system also includes a model optimization module 900. This model optimization module 900 is activated periodically or automatically after data accumulation reaches a certain scale. It uses high-quality contour data collected by the image correction module 700 and manually corrected by doctors as incremental training samples. By adjusting key parameters such as the learning rate, loss function, optimizer, and number of iterations, it periodically retrains and optimizes the deep learning model used in the image segmentation module. This process aims to continuously absorb clinical experience, improve the model's generalization ability and overall stability for complex, blurred, or novel scar morphologies, and ultimately achieve a continuous improvement in the system's segmentation accuracy and robustness.

[0097] Specifically, considering the functions of the above modules, the clinical application process of this system can be summarized as follows: First, doctors use a mobile device application (such as a smartphone) integrated with the system to take photos of the scar, including a dimensional reference point (a dot with a diameter of 1 cm). The original scar image is then uploaded to the system's image acquisition module 100 via the network, enabling automatic image acquisition and cloud synchronization. This process is convenient and efficient, allowing doctors to directly upload photos to the backend system for image segmentation and surface area calculation via their mobile applications. The system automatically collects, stores, and manages the image data, ensuring the timeliness and standardization of data processing.

[0098] Correspondingly, the system's image preprocessing module 200 automatically crops and sharpens the image to generate an enhanced scar image. The image segmentation module 300 calls the pre-trained TransUNet model and color threshold segmentation technology to generate mask images that identify the scar area and the reference object area, respectively. The contour acquisition module 400 extracts the precise pixel contours from the mask images, and the area calculation module 500 calculates the actual physical area of ​​the scar based on the known physical dimensions of the reference object.

[0099] Building upon this foundation, the system's report generation and display module 600 integrates the automatically generated, contour-overlaid scar image with calculated area and morphological parameters into a visual report, displayed on the doctor's workstation or mobile device screen. Doctors can use this report to make a preliminary assessment of the scar's condition and plan personalized dressing cuts based on the contour shape. If there are doubts about the automatically segmented boundaries, doctors can manually adjust the contours through the interactive interface provided by the image correction module 700. For example, they can add experience-based values ​​to further correct the image to better align with their clinical judgment. The system will update the area calculation results in real time based on the corrected contours, thereby further accurately calculating the cost of scar dressings and scar treatment.

[0100] Furthermore, for long-term follow-up of patient treatment, doctors can submit standardized image sequences taken at different treatment stages (such as before treatment and multiple follow-up points after treatment) to the efficacy prediction module 800. This module will analyze the time-series images and output a trend prediction of the future scar repair status, providing data support for dynamically adjusting the treatment plan.

[0101] Ultimately, the system continuously collects and utilizes feedback data provided by doctors during the correction process through the model optimization module 900, periodically performing incremental learning and parameter optimization on the image segmentation model. This allows the system's automated segmentation capabilities to continuously improve and evolve during clinical use, thereby providing increasingly accurate and reliable intelligent diagnosis and treatment services for both doctors and patients.

[0102] In summary, this invention proposes an artificial intelligence-based method and system for calculating scar area, deeply integrating computer vision, deep learning, and clinical diagnostic workflows. This invention achieves end-to-end automation and intelligence across the entire process, from scar image acquisition, intelligent segmentation, accurate area calculation, dynamic efficacy prediction to personalized dressing preparation guidance.

[0103] Compared with the prior art, the present invention has the following significant advantages: High measurement accuracy and objectivity: By introducing the TransUNet hybrid coding network, this invention effectively combines the local feature extraction capability of CNN with the global context modeling advantage of Transformer, and supplements it with attention mechanism and morphological post-processing. This overcomes the problems of strong subjectivity and inaccurate measurement of irregular and fuzzy boundary scars in traditional manual measurement or threshold segmentation methods, and realizes high-precision and repeatable automated area calculation.

[0104] Strong clinical applicability and integration: This invention designs an interactive workflow of "automatic calculation - expert correction", which allows doctors to fine-tune the AI ​​results based on experience, realizing the effective integration of artificial intelligence and human expert knowledge; at the same time, the automatically generated contour overlay images and quantitative reports provide intuitive and reliable objective basis for dressing shape customization and treatment cost calculation.

[0105] With dynamic prediction and continuous evolution capabilities: This invention goes beyond static measurement, and can analyze multi-temporal image sequences to predict scar repair trends, providing forward-looking guidance for the dynamic adjustment of treatment plans; at the same time, it can continuously optimize the AI ​​model using clinical feedback data, enabling the system to have the ability to self-iterate and continuously improve performance.

[0106] Efficient process and easy integration: This invention supports convenient image acquisition via mobile devices, automatic backend processing and rapid return of results, which greatly improves diagnostic and treatment efficiency. The entire system can be deployed in a modular manner and is easy to integrate with existing hospital information systems (HIS) or mobile medical platforms, with good scalability and promotion prospects.

[0107] It is evident that this invention not only provides an innovative technical tool for the accurate assessment of pathological scars, but also offers a complete solution for achieving personalized and refined scar treatment management, possessing significant clinical value and application potential.

[0108] The above description is merely a preferred embodiment of the present invention and does not limit the implementation and protection scope of the present invention. Those skilled in the art should realize that any equivalent substitutions and obvious changes made based on the description and illustrations of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for calculating scar area based on artificial intelligence, characterized in that, include: Step S1: Obtain the patient's original scar image, which includes the scar area and a preset scale reference area; Step S2: Perform preprocessing on the original scar image to generate an enhanced scar image; Step S3: Semantic segmentation is performed on the enhanced scar image using the trained image segmentation model to obtain a first mask image identifying the scar region. The enhanced scar image is then processed using image processing techniques to obtain a second mask image identifying the scale reference object region. Step S4: Based on the first mask image and the second mask image, extract the first pixel contour of the scar region and the second pixel contour of the scale reference region, respectively. Step S5: Based on the first pixel contour and the second pixel contour, and in combination with the known geometric dimensions of the scale reference area, calculate the physical area of ​​the scar region to obtain the patient's scar area.

2. The scar area calculation method based on artificial intelligence according to claim 1, characterized in that, Step S2 includes: Step S21: Perform a center cropping operation on the original scar image to generate a cropped image, wherein the cropped image focuses on the scar region and the scale reference area; Step S22: Perform image sharpening operation on the cropped image to generate the enhanced scar image.

3. The method for calculating scar area based on artificial intelligence according to claim 1, characterized in that, In step S3, the image segmentation model is a TransUNet network model based on a convolutional neural network encoder and a Transformer encoder. The TransUNet network model integrates channel attention mechanism and spatial attention mechanism. The image processing technique is color threshold segmentation.

4. The scar area calculation method based on artificial intelligence according to claim 3, characterized in that, The training process of the image segmentation model is optimized using a binary classification cross-entropy loss function.

5. The method for calculating scar area based on artificial intelligence according to claim 1, characterized in that, Step S4 includes: Step S41: Perform morphological erosion and dilation operations on the first mask image and the second mask image respectively; Step S42: Extract the boundary pixel coordinates of the first mask image and the second mask image after morphological operation to obtain the first pixel contour and the second pixel contour.

6. The method for calculating scar area based on artificial intelligence according to claim 1, characterized in that, Step S5 includes: Step S51: Calculate the first pixel area of ​​the scar region based on the first pixel contour; Step S52: Calculate the second pixel area of ​​the scale reference area based on the second pixel contour; Step S53: Calculate and generate the patient's scar area based on the area of ​​the first pixel, the area of ​​the second pixel, and the geometric dimensions of the scale reference area. The specific calculation formula is as follows: ; in, The area of ​​the patient's scar. The area of ​​the first pixel. The area of ​​the second pixel. The geometric dimensions of the scale reference area are given.

7. The method for calculating scar area based on artificial intelligence according to claim 1, characterized in that, Also includes: Step S6: Draw the first pixel contour and the second pixel contour on the original scar image or the enhanced scar image to generate a contour overlay image.

8. The method for calculating scar area based on artificial intelligence according to claim 7, characterized in that, It also includes step S7, which predicts the scar repair effect for the patient, and step S7 includes: Step S71: Obtain a sequence of scar images containing the scar area and the scale reference area for the patient at n stages before and after treatment, where n is a positive integer; Step S72: Normalize the scar regions contained in each image in the scar image sequence to a uniform physical scale; Step S73: Input the normalized scar image sequence into the trained efficacy prediction model to obtain the predicted scar efficacy status at the (n+1)th stage after the patient's treatment.

9. A scar area calculation system based on artificial intelligence, characterized in that, A method for implementing an artificial intelligence-based scar area calculation method as described in any one of claims 1-8 includes: The image acquisition module is used to acquire the patient's original scar image, which includes the scar area and a preset scale reference area; An image preprocessing module, connected to the image acquisition module, is used to preprocess the original scar image to generate an enhanced scar image; The image segmentation module, connected to the image preprocessing module, is used to perform semantic segmentation on the enhanced scar image using a trained image segmentation model to obtain a first mask image identifying the scar region, and to process the enhanced scar image using image processing techniques to obtain a second mask image identifying the scale reference object region. The contour acquisition module, connected to the image segmentation module, is used to extract the first pixel contour of the scar region and the second pixel contour of the scale reference area based on the first mask image and the second mask image, respectively. An area calculation module, connected to the contour acquisition module, is used to calculate the physical area of ​​the scar region based on the first pixel contour and the second pixel contour, combined with the known geometric dimensions of the scale reference area, so as to obtain the patient's scar area.

10. The scar area calculation system based on artificial intelligence according to claim 9, characterized in that, Also includes: The report generation and display module is connected to the area calculation module and is used to present the contour overlay image and the patient's scar area on the display interface, and generate an analysis report containing quantitative data based on the contour overlay image and the patient's scar area. The image correction module, connected to the contour acquisition module, is used to interactively modify the contour of the first pixel based on the adjustment command input by the user, and send the modified contour data to the area calculation module to update the scar area calculation result.