Breast cancer canceration risk pathological detection method and system for improving light weight model
By improving the HSV color space conversion, Otsu thresholding algorithm, and morphological processing of the lightweight model, and combining the ECA mechanism and a lightweight convolutional neural network with hybrid activation functions, the application challenges of WSI cancer detection in breast cancer pathology in primary healthcare institutions have been solved, achieving efficient and accurate cancer risk assessment and interpretable detection results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-07
- Publication Date
- 2026-06-16
AI Technical Summary
Existing breast cancer pathology WSI cancer detection methods cannot be effectively applied in primary healthcare institutions due to problems such as large model parameter count, high computational resource consumption, insufficient detection accuracy, poor spatial continuity of detection results, and insufficient clinical interpretability.
An improved lightweight model is adopted, which is preprocessed by HSV color space conversion, Otsu thresholding algorithm and morphological processing. The lightweight convolutional neural network with ECA mechanism and hybrid activation function is used to predict the cancer probability. Spatial consistency constraint and Gaussian kernel smoothing are introduced to generate a continuous cancer risk distribution.
It significantly reduces computational complexity and the number of model parameters, improves detection efficiency and spatial continuity and clinical interpretability of results, and is suitable for early breast cancer screening in primary healthcare institutions.
Smart Images

Figure CN122224474A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital pathology and artificial intelligence-assisted diagnosis technology, specifically involving an improved lightweight model for pathological detection of breast cancer risk, which involves the cross-application of biomedical engineering and deep learning technology, and is geared towards digital healthcare, telemedicine, precision medicine and big health screening scenarios. Background Technology
[0002] In clinical pathological diagnosis, histopathology is the gold standard for diagnosing tumors such as breast cancer and is the core basis for developing clinical treatment plans. However, whole-slide images (WSI) have ultra-high resolution and single-image data sizes can reach several gigabytes. Please refer to [link to relevant documentation]. Figure 1 Traditional manual slide reading requires pathologists to examine tissue slides field by field under a microscope. This not only involves high reading intensity, low diagnostic efficiency, and long time consumption, but also relies heavily on the doctor's professional skills and clinical experience, resulting in significant subjective diagnostic differences. Especially when early breast cancer lesions are atypical in morphology and small in area, it is very easy to miss or misdiagnose, making it difficult to meet the needs of large-scale early breast cancer screening, remote consultation, and widespread application in primary healthcare institutions.
[0003] Please see Figure 2 With the development of digital pathology scanning technology, whole-slice imaging (WSI) technology has matured, enabling the digital storage of complete pathological slides at ultra-high resolution. This propels pathology into the digital pathology stage and provides a data foundation for computer-aided analysis and AI-assisted diagnosis (CAD) of pathological images. In recent years, researchers have proposed deep learning-based automated WSI cancer detection methods. By segmenting WSI images, they can identify cancerous lesions in local tissue regions, improving the efficiency of pathological diagnosis to some extent and demonstrating good application potential. However, existing technologies still face core technical bottlenecks in clinical implementation, resulting in a significant gap between current solutions and the actual needs of early screening at the grassroots level. Firstly, existing high-precision detection solutions generally employ complex, parameter-intensive deep convolutional neural network models. While these models can achieve high detection accuracy in laboratory environments, their training and inference processes heavily rely on high-performance GPUs, resulting in high computational resource consumption, high deployment costs, and strong hardware dependence. This limits their widespread adoption in grassroots medical institutions with limited computing power, mobile medical terminals, and remote consultation systems. Secondly, existing general-purpose lightweight network models, designed for mobile natural image classification tasks, are not adapted to the characteristics of pathological images, such as extremely small cancerous areas, subtle morphological changes, and weak staining gradient differences. When directly applied to pathological image detection, they suffer from overly smoothed features, insufficient sensitivity in identifying small cancerous areas, overfitting, and poor generalization ability. These issues fail to meet the stringent requirements of pathological diagnosis for both detection accuracy and false negative rates, making it impossible to achieve a reasonable balance between detection accuracy and deployment costs.
[0004] Secondly, existing methods do not have a targeted preprocessing workflow designed for the large size and high redundancy of WSI. Most of them directly process the whole slice image into blocks. However, the proportion of blank background and invalid areas without organizational information in WSI images is extremely high. The processing of a large number of invalid areas introduces serious computational redundancy, which not only further increases the requirements for hardware computing power, but also significantly reduces the overall processing efficiency of WSI images, making it difficult to achieve rapid screening of batch samples.
[0005] Third, most existing methods only achieve patch-level binary classification results for cancerous lesions, lacking a clinically-guided risk expression mechanism for whole-slice level. They simply perform spatial mapping and superposition of patch-level prediction results, which can easily lead to problems such as probability mutations in adjacent areas and spatial breaks in risk distribution due to independent predictions. They cannot truly reflect the continuous distribution characteristics of cancerous areas, nor can they accurately locate suspected lesions. The interpretability of the test results is poor, and they cannot effectively assist pathologists in completing slide review and verification work, making it difficult to adapt to the actual workflow of clinical pathology diagnosis.
[0006] In summary, the key technical problem that urgently needs to be solved in the field of digital pathology cancer screening is how to significantly reduce model complexity and computational resource consumption while ensuring the accuracy of breast cancer detection and controlling the rate of missed diagnoses, and at the same time improve the efficiency of WSI image processing and the clinical interpretability of detection results. Summary of the Invention
[0007] The technical problem to be solved by this invention is to provide an improved lightweight model for the pathological detection of breast cancer risk, addressing the shortcomings of the prior art. This method solves the problems of existing breast cancer pathological WSI cancer detection methods, which cannot balance detection accuracy and model lightweightness. These problems include large model parameters, high computational cost, and difficult deployment. General lightweight models have insufficient sensitivity in identifying small cancerous areas in pathological images and are prone to overfitting. At the same time, WSI image processing involves redundant calculations, resulting in low detection efficiency, poor spatial continuity of detection results, and insufficient clinical interpretability, making it difficult to implement in primary healthcare institutions and large-scale early screening scenarios.
[0008] The present invention adopts the following technical solution: An improved lightweight model for pathological detection of breast cancer risk includes the following steps: S1. Obtain the whole slice image (WSI) of breast tissue pathology, perform rapid preview and preliminary localization of tissue regions at a low resolution level 6; convert the WSI from RGB color space to HSV color space, perform binarization based on the brightness distribution characteristics of the V channel, combined with the Otsu automatic thresholding algorithm and the lower limit threshold of brightness, and perform morphological closing and opening operations on the binarization result to obtain the tissue region mask. S2. Map the tissue region mask from the low-resolution level back to the original high-resolution level, establish the pixel coordinate ratio relationship, and perform regular cropping within the effective tissue region according to the preset size to obtain an image patch carrying spatial coordinate information. S3. Input each image patch into the improved lightweight model for cancer probability prediction. The improved lightweight model includes: replacing the SE attention mechanism in the Bottleneck module with the ECA mechanism; adopting a hybrid activation function strategy, using the ReLU activation function in layers 1-8 and the h-swish activation function in layers 9-16; and setting a dropout layer with a dropout rate of 0.3 before the Global AveragePooling layer of the classification head. S4. Establish a one-to-one correspondence between the cancer probability value of each image patch and its spatial coordinates and map it back to the full slice spatial scale. In the mapping stage, introduce spatial consistency constraints and neighborhood weighted fusion strategies, and combine Gaussian kernel smoothing to reconstruct the continuous cancer risk distribution. S5. The continuous cancer risk distribution is subjected to threshold adaptive classification to generate multi-level risk regions of low risk, suspicious region and high risk, and the high-risk region is subjected to contour extraction and boundary refinement to obtain the pathological detection results of breast cancer risk.
[0009] Preferably, in step S1, the tissue region extraction includes: using the V channel brightness distribution to separate the bright background region from the tissue region, so as to filter out the slide background and blank areas.
[0010] Preferably, in step S1, the morphological closing and opening operations are used to fill the pores inside the tissue region and remove isolated noise points.
[0011] Preferably, in step S2, the effective tissue area is cropped according to a preset size of 256×256 pixels.
[0012] Preferably, in step S2, each image patch retains its spatial coordinate information in the full slice image.
[0013] Preferably, in step S3, the ECA mechanism includes: performing global average pooling on the feature map output by the Bottleneck module to generate channel descriptors, and learning the cross-dependencies between channels through 1D convolution to obtain channel attention weights.
[0014] Preferably, in step S3, the kernel size k of the 1D convolution is adaptively calculated according to the number of channels C, satisfying k=log2(C)+1. The improved lightweight model uses a cross-entropy loss function based on probability output to constrain and optimize the model output during the training phase.
[0015] Preferably, in step S4, the continuous cancer risk distribution is constructed by combining spatial consistency constraints, neighborhood weighted fusion strategy and Gaussian kernel smoothing to reduce spatial breaks caused by independent prediction.
[0016] Preferably, in step S5, a closed contour is automatically generated for the high-risk area based on the threshold adaptive grading result, and the boundary is refined to mark the boundary of suspected cancerous tissue.
[0017] Secondly, embodiments of the present invention provide an improved lightweight model-based pathological detection system for breast cancer risk, comprising: The preprocessing module is used to acquire whole-slice images of breast tissue pathology (WSI), complete the preliminary localization of tissue regions at low resolution, color space conversion, binarization and morphological processing, and generate tissue region masks. The segmentation module is used to map the tissue region mask back to the original high-resolution layer, establish the pixel coordinate ratio relationship, complete the regular cropping of the effective tissue region, and output the image patch carrying spatial coordinate information. The prediction module, equipped with an improved lightweight model, is used to predict the cancer probability of the input image patch and output the cancer probability value corresponding to each image patch. The improved lightweight model includes: a Bottleneck module replaced with an ECA mechanism, a hybrid activation unit using the ReLU activation function in layers 1-8 and the h-swish activation function in layers 9-16, and a Dropout layer with a dropout rate of 0.3 set before the Global Average Pooling layer of the classification head. The reconstruction module is used to map the cancer probability value of each image patch back to the spatial scale of the whole slice, complete the spatial consistency constraint, neighborhood weighted fusion and Gaussian kernel smoothing, and reconstruct the continuous cancer risk distribution. The output module is used to perform threshold adaptive grading of continuous cancer risk distribution, generate multi-level risk regions, complete the contour extraction and boundary refinement of high-risk regions, and output the pathological detection results of breast cancer risk.
[0018] Thirdly, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the improved lightweight model for pathological detection of breast cancer risk described above.
[0019] Fourthly, embodiments of the present invention provide a computer-readable storage medium including a computer program, which, when executed by a processor, implements the steps of the above-described improved lightweight model for pathological detection of breast cancer risk.
[0020] Fifthly, a chip includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the improved lightweight model for pathological detection of breast cancer risk described above.
[0021] In a sixth aspect, embodiments of the present invention provide an electronic device including a computer program, wherein when the computer program is executed by the electronic device, it implements the steps of the above-described improved lightweight model for pathological detection of breast cancer risk.
[0022] Compared with the prior art, the present invention has at least the following beneficial effects: An improved lightweight model for pathological detection of breast cancer risk addresses the computational redundancy of directly processing ultra-large WSI images through a level 6 low-resolution preprocessing workflow. HSV color space conversion combined with Otsu thresholding and morphological processing accurately separates tissue and background regions, significantly reducing unnecessary computation and noise interference. Three targeted improvements to MobileNetV3, tailored to the characteristics of pathological images, address the core pain points of general lightweight models, such as overly smoothed features in pathological scenes, insufficient sensitivity in identifying small lesions, and susceptibility to overfitting, ensuring detection accuracy while reducing model parameters. Through probabilistic reconstruction with spatial consistency constraints and multi-level risk grading, the methods overcome the spatial fragmentation and poor clinical interpretability of traditional methods, achieving a complete closed loop from local patch prediction to full-slice risk assessment, balancing detection accuracy, operational efficiency, and clinical applicability.
[0023] Furthermore, the V channel of the HSV color space can effectively separate image brightness and color information. Pathological tissue areas exhibit fixed brightness distribution characteristics due to HE staining, while the blank background of the slide shows high brightness. The brightness distribution of the V channel can stably distinguish between the two, avoiding segmentation errors caused by staining differences and uneven illumination in the RGB color space. This further enhances the accuracy of background filtering, maximizing the removal of invalid information such as slide background and blank areas, reducing the amount of unnecessary computation in subsequent model inference from the source, improving overall processing efficiency, and avoiding noise interference introduced by blank areas, reducing the risk of model misjudgment, and further improving the robustness and stability of the preprocessing steps.
[0024] Furthermore, the binarized results obtained from Otsu thresholding are prone to problems such as internal holes in tissue sections and isolated noise in background areas due to factors like uneven staining of tissue sections, internuclear spaces, and scanning artifacts. Directly using these results for subsequent cropping can lead to the omission of effective tissue or the inclusion of invalid areas. Morphological closing operations can first fill in small holes within the tissue and connect broken tissue areas, ensuring the integrity of the effective tissue area; opening operations can remove isolated noise in the background, further refining the masking results. This significantly improves the coherence and accuracy of tissue region masks.
[0025] Furthermore, the patch cropping size directly determines the model's input scale, receptive field, and inference efficiency. An excessively large size leads to each patch containing too much irrelevant background, reducing the model's sensitivity to small lesions; an excessively small size results in patches lacking overall structural information of the tissue glands, failing to capture cancer-related abnormal tissue arrangement features. A cropping size of 256×256 pixels is suitable for the cellular resolution of pathological scan images at 40× magnification. This size fully preserves the morphological structure, texture distribution, and other cancer-related features of individual glands and cell nuclei, providing sufficient semantic information for the model, while controlling the computational load of each patch, meeting the input requirements of lightweight models, and ensuring the efficiency of dense sliding window inference. Simultaneously, this size matches the conventional visual scale of clinical pathology diagnosis, making the model's prediction results more easily aligned with the reading habits of pathologists, further improving the clinical adaptability of the detection results.
[0026] Furthermore, cancer detection in WSI images ultimately requires risk localization and visualization at the whole-slice scale. However, model inference is performed on individual patches. If spatial coordinate information is missing, the cancer probability at the patch level cannot be restored to the corresponding position in the original image, resulting in isolated classification results. This makes it impossible to achieve risk assessment and lesion localization at the whole-slice scale.
[0027] Furthermore, the SE attention mechanism used in the original MobileNetV3 learns channel dependencies through fully connected layers, which introduces additional parameters and computational overhead. At the same time, it is prone to losing the direct correspondence between channels due to dimensionality reduction. However, cancer-related features in pathological images are often concentrated in specific channels, which places higher demands on the accuracy and lightweight characteristics of channel attention. The ECA mechanism generates channel descriptors through global average pooling and replaces fully connected layers with 1D convolutions, avoiding information loss caused by dimensionality reduction. At the same time, the convolution kernel size is adaptively adjusted according to the number of channels, accurately capturing the dependencies between local channels. While significantly reducing the number of parameters and computational cost of the attention module, it improves the weighting effect on key cancer-related feature channels, allowing the model to focus more on cancer-related features such as nuclear atypia and glandular structural abnormalities. This further improves the feature extraction efficiency and classification accuracy of the lightweight model, achieving simultaneous optimization of model lightweighting and detection performance.
[0028] Furthermore, the adaptive calculation method for convolutional kernel size can dynamically adjust the receptive field range according to the number of channels in different network layers, avoiding the channel-dependent learning insufficiency or overfitting problems caused by fixed convolutional kernels. This allows the attention mechanism to adapt to the feature channel characteristics of different layers, further improving the accuracy of channel weighting. The cross-entropy loss function based on probability output is perfectly suited for the binary classification task of normal / cancer breast cancer pathology images. It can accurately quantify the error between the model's predicted probability and the true label, effectively constraining the model's training process through error backpropagation. This solves the classification convergence problem under the balance of pathological sample categories, allowing the model to simultaneously consider the classification accuracy of normal and cancerous tissues, balancing recall and precision. This avoids the problems of missed diagnoses or over-misdiagnoses in early cancer screening scenarios, further improving the model's convergence effect and generalization ability.
[0029] Furthermore, spatial consistency constraints force adjacent patches to maintain a reasonable and continuous trend in risk probabilities. Neighborhood-weighted fusion combines the risk probability of each location with the prediction results of surrounding patches, reducing the impact of single-patch prediction errors. Gaussian kernel smoothing further eliminates noise from probability mutations, ultimately generating a risk distribution that conforms to the continuous growth characteristics of pathological tissue cancer. This constraint significantly reduces spatial discontinuities caused by independent predictions, making the risk distribution results more closely match the spatial morphology of actual lesions, improving the spatial continuity and clinical interpretability of the detection results, and providing a more reliable basis for subsequent risk stratification and lesion localization.
[0030] Furthermore, during slide review, pathologists not only need to know whether the slides pose a risk of cancerous transformation, but also need to quickly locate the specific location and boundaries of suspected cancerous areas. However, simple risk heatmaps cannot provide precise lesion boundary information, still requiring manual verification by doctors. By automatically generating closed contours for high-risk areas, the boundaries of suspected cancerous tissue can be accurately marked. Simultaneously, boundary refinement eliminates jagged artifacts in the contours, making them more closely resemble the true morphology of the lesion. This upgrades the test results from probabilistic visualization to precise lesion localization, directly assisting pathologists in quickly locating areas for review, significantly reducing the scope of manual slide review, improving diagnostic efficiency, and providing structured boundary data for subsequent quantitative lesion analysis and pathological grading assessment, further expanding the clinical application value of the detection method.
[0031] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.
[0032] In summary, the method of this invention significantly reduces computational complexity and model parameter scale through effective region screening and lightweight model design, improves inference speed and system deployment flexibility, and enhances the interpretability and stability of detection results by utilizing spatial probability reconstruction. It is suitable for clinical early screening scenarios and multi-platform deployment environments, and has good application prospects and promotion value.
[0033] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0034] Figure 1 This is a schematic diagram of the traditional manual diagnostic process; Figure 2 This is a schematic diagram of a digital scanning microscopy imaging system. Figure 3 A schematic diagram illustrating the evaluation of cancer CAD systems by histopathology. Figure 4 This is a schematic diagram of a lightweight early cancer screening technology. Figure 5 This is a flowchart of the testing technology process; Figure 6 A flowchart for a lightweight early cancer screening and detection process; Figure 7 Schematic diagram for preparing H&E pathology sections; Figure 8 Here is a flowchart of the image preprocessing process; Figure 9 Image preprocessing logic diagram; Figure 10 This is a schematic diagram of the attention module; Figure 11 Obtain the flowchart for the probability graph; Figure 12 This is a diagram illustrating the changes in loss during training. Figure 13 This is a schematic diagram illustrating the validation set performance. Figure 14 This is a schematic diagram illustrating the performance results of the test set; Figure 15 For heatmaps; Figure 16 A schematic diagram of a computer device provided in an embodiment of the present invention; Figure 17 This is a block diagram of a chip provided according to an embodiment of the present invention.
[0035] Among them, 60. Computer equipment; 61. Processor; 62. Memory; 63. Computer program; 600. Electronic device; 610. Processing unit; 620. Storage unit; 6201. Random access memory unit; 6202. Cache memory unit; 6203. Read-only memory unit; 6204. Program / utility; 6205. Program module; 630. Bus; 640. Display unit; 650. Input / output interface; 660. Network adapter; 700. External device. Detailed Implementation
[0036] 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, not all, of the embodiments of the present invention. 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.
[0037] In the description of this invention, it should be understood that the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0038] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0039] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this invention generally indicates that the preceding and following objects have an "or" relationship.
[0040] It should be understood that although terms such as first, second, third, etc., may be used in the embodiments of the present invention to describe the preset range, these preset ranges should not be limited to these terms. These terms are only used to distinguish the preset ranges from one another. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0041] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0042] The accompanying drawings illustrate various structural schematic diagrams according to embodiments disclosed in this invention. These drawings are not to scale, and some details have been enlarged for clarity, and some details may have been omitted. The shapes of the various regions and layers shown in the drawings, as well as their relative sizes and positional relationships, are merely exemplary and may deviate from reality due to manufacturing tolerances or technical limitations. Furthermore, those skilled in the art can design regions / layers with different shapes, sizes, and relative positions as needed.
[0043] How to reduce model complexity and computational cost while ensuring the accuracy of cancer detection, and achieve efficient analysis of full-view pathological slides, has become a key problem that urgently needs to be solved in the field of digital pathology cancer early screening. Based on this problem, this invention proposes an improved lightweight model for breast cancer risk pathological detection, achieving efficient analysis and intelligent assisted diagnosis of large-size pathological images through a multi-stage processing flow. Specifically, this invention adopts a hierarchical processing mechanism of "low-resolution screening + local region analysis + lightweight model prediction + probability mapping reconstruction": First, at the low-resolution level, tissue region detection and background separation are performed on WSI images to narrow the effective analysis range and reduce unnecessary computation; second, within the effective tissue region, patch-level cropping is performed according to preset rules, analyzing only local regions with tissue information; then, a lightweight convolutional neural network with channel attention mechanism is used to predict the cancer probability of the patch image, achieving local lesion identification and classification; finally, the patch-level predicted probability is mapped back to the original WSI coordinate system according to its spatial coordinates to construct a cancer probability distribution map, achieving slice-level risk assessment and spatial visualization. The detection method is as follows: Figure 4 As shown, by performing layered analysis and key region feature extraction on the full-view pathological slices, redundant calculations for irrelevant regions are reduced. At the same time, a lightweight deep learning model structure is introduced, which significantly reduces the consumption of computing resources while ensuring detection performance.
[0044] Please see Figure 5 and Figure 6This invention discloses an improved lightweight model for pathological detection of breast cancer risk. It aims to construct an early cancer screening and detection scheme based on digital pathological images and a lightweight artificial intelligence model. Through efficient feature extraction and intelligent discrimination of pathological tissue images, it achieves rapid and accurate identification of cancerous areas. The specific steps are as follows: S1. Obtain pathological tissue samples to be tested from human or animal tissues. After routine paraffin embedding, formalin fixation and sectioning, obtain WSI images using a whole-section scanning device. Please see Figure 7 The pathological sample preparation process adopted in this invention conforms to the standard operating procedures of conventional pathology laboratories and has good versatility and clinical applicability. First, fresh tissue is fixed in 10% neutral formalin to maintain tissue morphological stability and prevent autolysis and putrefaction. Then, it is dehydrated using graded ethanol treatment and cleared with a clearing agent to ensure good paraffin penetration. Next, the tissue is fully immersed in molten paraffin and embedded to form a paraffin block, providing support for subsequent sectioning. Continuous thin sections of approximately 3 μm thickness are prepared using a microtome, spread, transferred to glass slides, and dried and fixed. After dewaxing and rehydration, the sections are differentially stained with hematoxylin and eosin (HE) to enhance tissue structural contrast. After staining, dehydration and clearing are performed again, and finally, mounting medium is added and coverslips are placed to complete the slide preparation. This process is mature and stable and can be seamlessly integrated with existing pathological testing procedures.
[0045] After sample preparation, this invention performs digital scanning imaging on the tissue sections to obtain raw pathological image data for early cancer screening analysis. To ensure that the image data meets the requirements of subsequent intelligent analysis in terms of resolution, contrast, and tissue structure integrity, the Jiangfeng Digital Pathology Slide Scanner is selected for full-field digital scanning imaging of the tissue sections. The scanner is equipped with a high-precision two-dimensional motorized platform, which can automatically position, scan line by line, and stitch images of the entire pathological slide to obtain complete digital pathological images of the whole slide. During the scanning process, an objective lens with a magnification of 40× and a numerical aperture of 0.95 is used to image and acquire the tissue sections, balancing the observation of the overall tissue structure with the ability to resolve cellular details. The scanning speed is 20 x 25 seconds per 1.5 cm. 2 80 x 120 S / 1.5 cm 2 .
[0046] S2. Preprocessing operations are performed on the acquired digital pathology images, including image quality screening, background region removal, tissue region detection, and scale normalization, thereby eliminating invalid regions and reducing subsequent computational redundancy. Furthermore, the tissue regions are segmented according to a preset image cropping strategy to generate image patches for model analysis, adapting to the input requirements of the lightweight model. In digital pathology whole-slice images, in addition to the target tissue region, there are usually a large number of invalid background regions, such as blank areas on the slide, air bubbles, unevenly stained areas, or scanning artifacts. These invalid regions not only occupy a lot of storage space, but also introduce noise interference in subsequent cancer detection processes, significantly increasing computational complexity and reducing detection efficiency and accuracy. To address the above problems, this invention proposes an image preprocessing and effective tissue region extraction method for lightweight early cancer screening, which efficiently removes invalid background regions while ensuring the integrity of tissue structure information.
[0047] Please see Figure 8 and Figure 9 The specific steps are as follows: First, the acquired whole-slice digital pathology images undergo multi-resolution reading processing. Since the original whole-slice image data is enormous, directly performing full-image analysis at the highest resolution would consume excessive computational resources, hindering the practical deployment of a lightweight system. Therefore, this invention preferably performs rapid previewing and preliminary tissue region localization of the whole-slice images at a lower resolution level (level 6) to reduce the initial computational burden.
[0048] At low resolution, the read pathological images are converted from the RGB color space to the HSV color space. The HSV color space can effectively separate the color and brightness information of an image, with the V channel primarily reflecting the brightness distribution characteristics of the image. By analyzing the V channel, tissue regions and background regions can be distinguished relatively stably, providing a basis for subsequent thresholding.
[0049] Based on the brightness distribution characteristics of the V channel, this invention employs an adaptive thresholding method for preliminary extraction of tissue regions. In this implementation, the Otsu automatic thresholding algorithm is used to obtain the globally optimal segmentation threshold for the image, and a lower brightness threshold is set according to the actual scanning conditions. The image is then binarized to separate the tissue regions from the bright background regions. This method effectively filters out irrelevant areas such as the slide background and blank areas.
[0050] To further improve the integrity and continuity of tissue region extraction, morphological processing steps, including morphological closing and opening operations, are introduced based on the binarization results. This processing fills in small holes within the tissue region, removes isolated noise points, and makes the extracted tissue region more coherent and smooth, reducing the risk of false detections in subsequent analysis.
[0051] After obtaining the optimized tissue region mask, this invention maps the mask back from the low-resolution layer to the original high-resolution layer and establishes the proportional relationship between pixel coordinates. This mapping relationship allows for accurate location of the corresponding effective tissue region in the high-resolution full-slice image, providing precise spatial constraints for subsequent cropping processing based on fixed-size image blocks.
[0052] S3. In the feature extraction stage, the present invention uses a lightweight convolutional neural network or an improved efficient feature extraction model to perform deep feature representation learning on image blocks and automatically extract tissue structure features, cell morphology features and texture distribution features related to cancer. This invention improves the structure of a lightweight network based on MobileNetV3, aiming to make the model more suitable for early cancer detection tasks in dense sliding window scanning scenarios of whole-slice images (WSI), rather than just using it as a general image classifier. The traditional MobileNetV3_Small design is geared towards natural image recognition on mobile devices, emphasizing a balance between overall semantic representation and inference efficiency in feature representation, attention modeling strategies, and activation function selection. However, in pathological image scenarios, cancerous regions are often extremely small, with subtle morphological changes and weak staining gradient differences, and require tens of thousands of patch-level inferences on ultra-high resolution images. Therefore, the model faces the combined requirements of "high sensitivity in identifying minute anomalies + high-efficiency dense scanning + strong generalization ability." Based on this, this invention performs three targeted optimizations on the model: 1) Attention mechanism replacement: SE→ECA The original Portleneck module in the MobileNetV3_Small architecture uses the SE attention mechanism, but replaces SE with the ECA mechanism: the feature map output by the Portleneck module is first subjected to global average pooling to generate channel descriptors to capture the global response of each channel; then, 1D convolutions replace the fully connected layers, and the kernel size k is adaptively calculated according to the number of channels C (k=log2(C)+1). The cross-dependencies between channels are learned through the local receptive field, and channel attention weights W∈R are generated. C Finally, the weights are normalized using the Sigmoid activation function and multiplied by the original feature map to achieve channel weighting, such as... Figure 10 As shown.
[0053] 2) Activation function optimization: using a combination of ReLU and h-swish. MobileNetV3_Small uses the h-swish activation function by default. While it can balance accuracy and efficiency in general image tasks, it suffers from excessive feature smoothing in pathological image processing: the clarity of cell boundaries and staining gradient details, which are crucial for pathological diagnosis, are easily weakened by its smoothing properties.
[0054] Therefore, this invention employs a hybrid activation function strategy: the shallow modules (layers 1-8) use the ReLU activation function, leveraging its non-saturation properties to preserve low-level details such as cell edges and staining intensity changes, thus avoiding early feature loss; the deep modules (layers 9-16) still retain... It enhances the nonlinear expression of high-level semantic features (such as glandular abnormalities and nuclear atypia) through piecewise linearity.
[0055]
[0056] 3) Classification head anti-overfit design: Added Dropou layer The high cost and limited sample size of pathological image annotation (especially early-stage cancer samples) make models prone to overfitting on the training set, resulting in training accuracy far exceeding validation accuracy and insufficient generalization ability. To address this issue, this invention adds a Dropout layer before the Global Average Pooling layer in the classification head, setting the dropout rate to 0.3. During training, this layer randomly deactivates 30% of the deep feature channels, forcing the network to learn more stable multi-channel collaborative feature patterns (such as the correlation between cell nuclear morphology and cytoplasmic staining) instead of relying on feature signals from specific channels.
[0057] To achieve accurate identification of cancerous regions, this invention introduces a supervised learning mechanism during the model training phase and employs a classification loss function to constrain and optimize the model output. The loss function uses a cross-entropy loss function based on probability output, expressed as follows: (1) Where x represents the original logits output by the model; y represents the true label (0 indicates the negative class); σ(x) is the Sigmoid activation function, which maps the logits to the interval [0,1], representing the "probability of belonging to the positive class". During training, the input is a batch of samples, and the loss of each sample is calculated and then averaged.
[0058] S4. In the discrimination and screening stage, the extracted features are input into a lightweight classification model to predict the probability of cancerous and non-cancer changes in image blocks, and a threshold strategy is used to complete the preliminary screening judgment. For the whole slice image, the prediction results of each image block are spatially integrated and statistically analyzed to generate the cancer risk assessment results and a visualized heat map of the whole slice, which can be used to help doctors quickly locate suspected lesion areas.
[0059] Please see Figure 11 In view of the characteristics of high resolution, extremely low proportion of cancerous areas and uneven spatial distribution of whole-slice images (WSI), this invention does not just stop at simply visualizing the output probability of the model, but constructs a multi-level risk expression and localization mechanism for clinical decision support.
[0060] Specifically, after cropping fixed-size image blocks and obtaining the spatial coordinates of each block, an improved lightweight deep learning model is used to output cancer probability values for each block. These probability values are then linked to their original spatial coordinates, thus reconstructing a continuous risk distribution field on a full-slice spatial scale. Unlike traditional probability superposition methods used only for display, this invention introduces spatial consistency constraints and neighborhood weighted fusion strategies during the mapping stage. This ensures that risk information between adjacent image blocks exhibits a continuous trend, avoiding spatial fragmentation caused by independent predictions. Simultaneously, by combining Gaussian kernel smoothing and an adaptive threshold grading mechanism, the continuous probability distribution is transformed into multi-level risk regions, achieving a hierarchical representation of "low risk—suspicious region—high risk." This allows the system to not only visually present the overall risk distribution but also assist users in quickly identifying high-risk areas.
[0061] This invention supports contour extraction and boundary refinement based on risk gradients, automatically generating closed contours in high-risk areas for precise marking of suspected cancerous tissue boundaries, providing structured reference information for subsequent quantitative analysis or manual review. Through this construction method, the heatmap is no longer merely a simple color mapping result, but rather an auxiliary decision-making module integrating spatial continuity modeling, risk grading expression, and region contour extraction. This represents an upgrade from "probability output" to an application-level model that is "locatable, gradable, and labelable," thereby improving the detection efficiency and ease of use of early-stage cancerous areas in large-size pathological images.
[0062] In another embodiment of the present invention, an improved lightweight model-based pathological detection system for breast cancer risk is provided. This system can be used to implement the above-mentioned improved lightweight model-based pathological detection method for breast cancer risk. Specifically, the improved lightweight model-based pathological detection system for breast cancer risk includes a preprocessing module, a segmentation module, a prediction module, a reconstruction module, and an output module.
[0063] The preprocessing module is used to acquire whole-slice images of breast tissue pathology (WSI), complete the preliminary localization of tissue regions at low resolution, color space conversion, binarization and morphological processing, and generate tissue region masks. The segmentation module is used to map the tissue region mask back to the original high-resolution layer, establish the pixel coordinate ratio relationship, complete the regular cropping of the effective tissue region, and output the image patch carrying spatial coordinate information. The prediction module, equipped with an improved lightweight model, is used to predict the cancer probability of the input image patch and output the cancer probability value corresponding to each image patch. The improved lightweight model includes: a Bottleneck module replaced with an ECA mechanism, a hybrid activation unit using the ReLU activation function in layers 1-8 and the h-swish activation function in layers 9-16, and a Dropout layer with a dropout rate of 0.3 set before the Global Average Pooling layer of the classification head. The reconstruction module is used to map the cancer probability value of each image patch back to the spatial scale of the whole slice, complete the spatial consistency constraint, neighborhood weighted fusion and Gaussian kernel smoothing, and reconstruct the continuous cancer risk distribution. The output module is used to perform threshold adaptive grading of continuous cancer risk distribution, generate multi-level risk regions, complete the contour extraction and boundary refinement of high-risk regions, and output the pathological detection results of breast cancer risk.
[0064] This invention provides a terminal device comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, graphics processing units (GPUs), tensor processing units (TPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve a corresponding method flow or function. The processor described in this embodiment can be used to improve the operation of a lightweight model for pathological detection of breast cancer risk, including: Whole-slice images (WSI) of breast tissue pathology sections were acquired and quickly previewed and preliminarily located at a low-resolution level 6. The WSI images were then converted from RGB to HSV color space. Binarization was performed based on the V channel brightness distribution characteristics, combined with the Otsu automatic thresholding algorithm and a brightness lower limit threshold. Morphological closing and opening operations were then performed on the binarized results to obtain a tissue region mask. This tissue region mask was mapped back from the low-resolution level to the original high-resolution level, establishing pixel coordinate ratios. Within the effective tissue region, the images were cropped according to a preset size to obtain image patches carrying spatial coordinate information. Each image patch was input into an improved lightweight model for cancer probability prediction. This improved lightweight model included: replacing the SE attention mechanism in the Bottleneck module with an ECA mechanism; employing a hybrid activation function strategy, using ReLU activation for layers 1-8 and h-swish activation for layers 9-16; and setting dropout before the Global Average Pooling layer in the classification head. A Dropout layer with a rate of 0.3 is used to establish a one-to-one correspondence between the cancer probability value of each image patch and its spatial coordinates and map it back to the full slice spatial scale. In the mapping stage, spatial consistency constraints and neighborhood weighted fusion strategies are introduced, and Gaussian kernel smoothing is combined to reconstruct the continuous cancer risk distribution. The continuous cancer risk distribution is then subjected to threshold adaptive classification to generate multi-level risk regions of low risk, suspicious regions, and high risk. Contour extraction and boundary refinement are performed on the high-risk regions to obtain the pathological detection results of breast cancer risk.
[0065] Please see Figure 16 The terminal device is a computer device. In this embodiment, the computer device 60 includes a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When executed by the processor 61, the computer program 63 implements the improved lightweight model-based pathological detection method for breast cancer risk in this embodiment. To avoid repetition, details are omitted here. Alternatively, when executed by the processor 61, the computer program 63 implements the functions of each model / unit in the improved lightweight model-based pathological detection system for breast cancer risk in this embodiment. To avoid repetition, details are omitted here.
[0066] Computer device 60 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. Computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will understand that... Figure 16This is merely an example of computer device 60 and does not constitute a limitation on computer device 60. It may include more or fewer components than shown, or combine certain components, or different components. For example, computer device may also include input / output devices, network access devices, buses, etc.
[0067] The processor 61 may be a Central Processing Unit (CPU), or other general-purpose processors, graphics processing units (GPUs), tensor processing units (TPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0068] The memory 62 can be an internal storage unit of the computer device 60, such as a hard disk or memory of the computer device 60. The memory 62 can also be an external storage device of the computer device 60, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on the computer device 60.
[0069] Furthermore, the memory 62 may include both internal storage units of the computer device 60 and external storage devices. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 can also be used to temporarily store data that has been output or will be output.
[0070] Please see Figure 17 The terminal device is an electronic device 600, which is manifested in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including storage unit 620 and processing unit 610), a display unit 640, etc.
[0071] The storage unit stores program code, which can be executed by the processing unit 610 to perform the steps described in the method section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 610 can perform actions such as... Figure 6 The steps are shown in the figure.
[0072] Storage unit 620 may include readable media in the form of volatile storage units, such as random access memory (RAM) 6201 and / or cache memory 6202, and may further include read-only memory (ROM) 6203.
[0073] Storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0074] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the multiple bus structures.
[0075] Electronic device 600 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem). This communication can be performed via input / output interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network, wide area network, and / or public network, such as the Internet) via network adapter 660. Network adapter 660 can communicate with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0076] This invention also provides a storage medium, specifically a computer-readable storage medium, which is a memory device in a terminal device for storing programs and data. It is understood that the computer-readable storage medium here can include both built-in storage media in the terminal device and extended storage media supported by the terminal device; it can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor, which can be one or more computer programs (including program code). More specific examples of the computer-readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical fiber, portable compact disk read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.
[0077] Computer-readable storage media also include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium can also be any readable medium other than a readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, radio frequency, etc., or any suitable combination thereof.
[0078] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0079] One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the breast cancer risk pathological detection method with improved lightweight model in the above embodiments; one or more instructions in the computer-readable storage medium are loaded and executed by the processor in the following steps: Whole-slice images (WSI) of breast tissue pathology sections were acquired and quickly previewed and preliminarily located at a low-resolution level 6. The WSI images were then converted from RGB to HSV color space. Binarization was performed based on the V channel brightness distribution characteristics, combined with the Otsu automatic thresholding algorithm and a brightness lower limit threshold. Morphological closing and opening operations were then performed on the binarized results to obtain a tissue region mask. This tissue region mask was mapped back from the low-resolution level to the original high-resolution level, establishing pixel coordinate ratios. Within the effective tissue region, the images were cropped according to a preset size to obtain image patches carrying spatial coordinate information. Each image patch was input into an improved lightweight model for cancer probability prediction. This improved lightweight model included: replacing the SE attention mechanism in the Bottleneck module with an ECA mechanism; employing a hybrid activation function strategy, using ReLU activation for layers 1-8 and h-swish activation for layers 9-16; and setting dropout before the Global Average Pooling layer in the classification head. A Dropout layer with a rate of 0.3 is used to establish a one-to-one correspondence between the cancer probability value of each image patch and its spatial coordinates and map it back to the full slice spatial scale. In the mapping stage, spatial consistency constraints and neighborhood weighted fusion strategies are introduced, and Gaussian kernel smoothing is combined to reconstruct the continuous cancer risk distribution. The continuous cancer risk distribution is then subjected to threshold adaptive classification to generate multi-level risk regions of low risk, suspicious regions, and high risk. Contour extraction and boundary refinement are performed on the high-risk regions to obtain the pathological detection results of breast cancer risk.
[0080] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0081] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0082] The dataset used in this invention originates from clinical pathological tissue slide samples. All tissue slides were prepared and scanned according to standard pathological procedures, and are used for the research and validation of early cancer detection methods. The tissue slides cover both normal and cancerous tissue samples, reflecting the differences in tissue morphology under real clinical conditions. After formalin fixation and paraffin embedding, the tissue samples are cut into standard-thickness pathological slides. Each full-slide image has high resolution and large size, typically reaching hundreds of millions of pixels, with image sizes in the GB range, while also containing a large amount of effective tissue area and blank background area. After reading the WSI image, the full-slide image is regularly cropped according to a preset size (e.g., 256×256 pixels). Each image block retains its spatial coordinate information within the full-slide for subsequent heatmap construction.
[0083] Regarding the number of samples, to ensure the model has stable statistical learning capabilities, the training database typically requires a relatively balanced distribution of positive cancerous samples and negative normal samples. Generally, it is recommended that the number of effective image patches for both positive and negative samples be no less than several thousand, for example, no less than 3000 positive samples and no less than 3000 negative samples. When sample conditions permit, the data size can be appropriately increased to improve the model's generalization ability. Furthermore, the ratio of the training set to the validation set is set to 7:3. Due to sufficient data, an independent test set is further divided, forming a standard data organization structure of approximately 70% training set, 15% validation set, and 15% test set.
[0084] The experimental procedure is as follows: This experiment was implemented using the Python language, with the PyTorch deep learning framework. The experimental environment was a Windows 11 operating system, and the computer hardware configuration included: 64GB of memory, a 12th Gen Intel® Core™ i5-12400F processor with a clock speed of 2.50GHz, and an NVIDIA GeForce RTX 4060 graphics processing unit (8GB of video memory), which could meet the computational requirements for large-scale pathological image processing and deep learning model training.
[0085] Please see Figure 12 The experimental parameters for model training in this invention are set as follows: The Adam optimizer is used for parameter optimization, with an initial learning rate of 0.0001 to balance convergence speed and parameter update stability; to adapt to the memory limitations of basic devices and ensure the reliability of gradient estimation, the batch size is set to 32; the total number of training epochs is set to 30, ensuring the model fully learns pathological feature patterns while avoiding overfitting risks. The overall parameter configuration balances model training efficiency and convergence performance on the pathological dataset. Furthermore, to prevent overfitting and retain the optimal model parameters, a validation set is used to periodically evaluate the model. When the validation set performance reaches its current optimum, the model parameters are automatically saved. In addition, the model weights are saved every fixed training period (e.g., every 5 epochs) for subsequent analysis and comparative experiments.
[0086] To verify the effectiveness and practicality of the proposed method for early cancer detection based on a lightweight deep learning model, a systematic experiment was conducted on a real pathological dataset. The experimental results were analyzed from multiple aspects, including image block-level classification performance, full-slice-level detection effect, and spatial interpretability.
[0087] (a) Image block-level classification results In the patch-level classification experiment, a trained lightweight deep learning model was used to predict image patches in the test set, and the performance of the model under different evaluation metrics was statistically analyzed.
[0088] Using accuracy, precision, recall, and F1-score as evaluation metrics, the model maintained a high level of classification performance on the test set, indicating that the constructed lightweight network still possesses strong feature extraction and discrimination capabilities while ensuring computational efficiency.
[0089] 1) Precision Precision, also known as accuracy, reflects the proportion of true target samples among those identified as "target categories" by the model. It directly relates to the "accuracy" of image classification—high precision reduces the likelihood of misclassifying non-target images as target images, lowering the cost of unnecessary processing of irrelevant images in subsequent analysis. The calculation formula is as follows: (2) 2) Recall Recall, also known as sensitivity, reflects the model's "capture ability" of real target images and is a core requirement for image classification. High recall minimizes missed detections, ensuring that key target images (such as samples containing specific textures or structural features) can be effectively identified, providing a comprehensive foundation of target samples for subsequent image analysis. The calculation formula is as follows: (3) 3) F1 value The F1 score is the harmonic mean of precision and recall, balancing the performance of both. When precision and recall conflict (e.g., pursuing high recall may lead to more false positives and lower precision), the F1 score can serve as a quantitative standard for the overall performance of the model. The closer the F1 score is to 1, the better the model balances "comprehensive target capture" and "accurate target recognition," making it more suitable for the practical needs of image classification tasks that require "efficiency and reliability." The calculation formula is as follows: (4) The performance of the improved MobileNetV3_Small lightweight classification network on the validation set in this stage is as follows: The validation set contains 34,000 pathological image blocks, all of which are clinical samples from the First Affiliated Hospital of Xi'an Jiaotong University. Among them, there are 17,000 normal tissues (category 0) and 17,000 early lesion tissues (category 1). The set covers samples collected by different devices and under different staining conditions to fully verify the generalization ability of the model.
[0090] Please see Figure 13In terms of overall classification performance, the model achieved a ValAccuracy of 0.9426 on the validation set, meaning a 94.26% accuracy rate across 34,000 image patches, demonstrating high stability in the "normal / lesion" binary classification task. Specifically, in terms of sub-category performance, the precision for normal tissue (category 0) was 0.95, indicating that 95% of the samples classified as "normal" were indeed normal tissue, resulting in a low false positive rate and effectively reducing overdiagnosis caused by misclassifying normal tissue as lesions. Its recall was 0.94, indicating that 94% of all truly normal tissues were correctly identified by the model, with a low risk of missed diagnoses. The precision rate for early lesion tissue (Category 1) was 0.94, meaning that 94% of the samples identified as "lesions" by the model were real lesion tissue, which can avoid unnecessary anxiety and subsequent examination costs for patients caused by false positives to a certain extent. Its recall rate was 0.95, indicating that 95% of all real lesion tissues could be accurately captured by the model, with a low false negative rate, which meets the core requirement of "detecting early lesions as much as possible" in early cancer screening.
[0091] Overall, the F1 score for both categories was 0.94, indicating that the model performs well in balancing "reducing missed diagnoses" and "avoiding misdiagnosis," with no obvious class bias. The overall performance meets the requirements of primary-level cancer early screening for classification accuracy and reliability.
[0092] Please see Figure 14 In the test set evaluation phase, an independent test set (covering multi-center, multi-device imaging data) was constructed using clinically acquired pathological images to rigorously verify the model's generalization ability. For the binary classification task of "normal (category 0) / lesion (category 1)," the model exhibited the following performance characteristics: The classification results show that Category 0 (normal tissue) achieved a precision of 0.88, meaning that 88% of the samples predicted as normal by the model were actually normal tissue, effectively controlling the waste of medical resources and patient anxiety caused by overdiagnosis (misdiagnosing normal tissue as lesions). Its recall rate was 0.85, indicating that 85% of the truly normal tissue could be accurately identified, with the risk of missed diagnoses within an acceptable range. Category 1 (lesion tissue) also achieved a high recall rate of 0.88, indicating that 88% of the truly lesion samples could be accurately captured by the model, greatly reducing the risk of delayed diagnosis due to missed diagnoses. Its precision rate of 0.85 shows that 85% of the samples predicted as lesions were actually lesions, balancing the needs of "detecting lesions as much as possible" and "reducing misdiagnosis."
[0093] Both categories achieved an F1-score of 0.86, indicating that the model showed no significant bias in either task and exhibited balanced overall performance. This result validates the adaptability of the improved model in complex real-world scenarios. Although there were some fluctuations compared to the validation set (due to heterogeneity in the test set samples), the core indicators meet the clinical requirements of "controllable missed diagnoses and acceptable misdiagnoses" in early screening at the grassroots level, providing crucial evidence for subsequent deployment.
[0094] (II) Lightweighting Comparison Results Under the same testing environment and validation dataset conditions, a performance and lightweight comparison analysis was conducted on the four model structures. The experimental results are as follows: Table 1 Comparison Results of Lightweighting
[0095] Experimental results show that the baseline model (0_baseline) has 2,544,010 parameters, achieving an accuracy of 0.94 and an AUC of 0.98 on the test set, with a mean inference time of 0.0552 s per sample. After introducing the lightweight channel attention mechanism ECA (1_eca), the model's parameter count is reduced to 1,223,491, a reduction of approximately 51.9% compared to the baseline model, while the accuracy increases to 0.95, the AUC remains at 0.98, and the mean inference time per sample is shortened to 0.0514 s, representing an improvement in inference speed of approximately 6.8%. The traditional SE attention model (2_se) increases the parameter count to 2,590,154, but the accuracy is only 0.79, the AUC is 0.91, and the inference time increases to 0.0598 s, resulting in a significant decrease in both overall performance and efficiency.
[0096] The ultra-lightweight model (3_fast) has only 40,106 parameters, a reduction of approximately 98.4% compared to the baseline model. Despite this significant parameter reduction, it maintains an accuracy of 0.94 and an AUC of 0.98, showing almost no performance degradation. Its average inference time is 0.0583s, slightly higher than the ECA model, but it achieves near-baseline detection performance with an extremely low parameter size, validating the feasibility of the designed lightweight structure in resource-constrained environments. Comparing these results, it can be seen that the Fast structure excels in parameter compression and is suitable for edge deployment scenarios with extremely high requirements for model size.
[0097] Therefore, the lightweight improvement strategy proposed in this invention effectively reduces model complexity and inference overhead while ensuring the accuracy of early cancer detection, thus verifying its practical application value in clinical auxiliary diagnostic systems.
[0098] (III) Results of whole-slice-level cancer detection In the slide-level experiment, the trained model is used to predict all valid image blocks cropped from the full-slide image block by block, and the predicted cancer probability is mapped back to its spatial location in the original full-slide image to construct the corresponding cancer probability heatmap.
[0099] Please see Figure 15 The experimental results show that the generated heatmap can accurately reflect the spatial distribution characteristics of cancerous areas in the entire pathological section. High-probability areas show continuous or clustered distribution in space, and have a high degree of consistency with the pathologically labeled areas.
[0100] This invention addresses the practical application needs of early cancer detection in primary healthcare and resource-constrained environments by proposing an intelligent pathological image detection method and system based on a lightweight deep learning model. By constructing an improved lightweight network structure and combining image block-level classification with full-slice-level spatial mapping analysis, efficient identification and visualization of cancerous regions are achieved.
[0101] In the image block classification experiment, the improved MobileNet lightweight model showed good class balance and stability on the validation set, and maintained high performance on the test set, verifying its generalization ability and practical value in complex clinical scenarios.
[0102] In the lightweight comparative experiment, the extreme lightweight model (Fast structure) reduced the number of parameters by approximately 98.4% compared to the benchmark model, while still maintaining an accuracy of 0.94 and an AUC of 0.98. The detection performance showed virtually no significant degradation, demonstrating that the proposed lightweight structure design possesses good parameter efficiency and expressive power. Furthermore, the model's inference speed remained stable, meeting the needs of real-time or near-real-time assisted diagnosis and proving feasible for deployment on edge computing devices or primary healthcare terminals.
[0103] Therefore, this invention effectively reduces model complexity and computational resource consumption while ensuring the accuracy of early cancer detection, achieving a reasonable balance between detection accuracy, model size, and operational efficiency. This method and system are applicable to early cancer screening and auxiliary diagnosis in primary healthcare institutions, mobile medical terminals, and resource-constrained environments, and have good promotional value and industrialization prospects.
[0104] In summary, this invention presents an improved lightweight model for pathological detection of breast cancer risk. It employs a hierarchical lightweight processing framework for large WSI images, significantly reducing computational complexity and improving processing efficiency through a strategy combining low-resolution pre-selection and local fine-grained analysis. A cancer identification model based on a lightweight convolutional neural network is constructed, effectively reducing the number of model parameters and inference time while maintaining detection accuracy, thus reducing reliance on high-end hardware. An analysis mechanism combining patch-level prediction and slice-level risk aggregation is designed to achieve a structured expression from local identification to overall risk assessment, improving the stability and robustness of diagnostic results. While meeting detection accuracy requirements, it significantly reduces model complexity and system deployment costs, making it suitable for primary healthcare institutions, remote consultation platforms, and large-scale early cancer screening scenarios, demonstrating significant potential for widespread application.
[0105] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0106] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0107] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0108] In the embodiments provided by this invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0109] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0110] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0111] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random-access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0112] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0113] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0114] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0115] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.
Claims
1. An improved lightweight model for pathological detection of breast cancer risk, characterized in that, Includes the following steps: S1. Obtain the whole slice image (WSI) of breast tissue pathology, perform rapid preview and preliminary localization of tissue regions at a low resolution level 6; convert the WSI from RGB color space to HSV color space, perform binarization based on the brightness distribution characteristics of the V channel, combined with the Otsu automatic thresholding algorithm and the lower limit threshold of brightness, and perform morphological closing and opening operations on the binarization result to obtain the tissue region mask. S2. Map the tissue region mask from the low-resolution level back to the original high-resolution level, establish the pixel coordinate ratio relationship, and perform regular cropping within the effective tissue region according to the preset size to obtain an image patch carrying spatial coordinate information. S3. Input each image patch into the improved lightweight model for cancer probability prediction. The improved lightweight model includes: replacing the SE attention mechanism in the Bottleneck module with the ECA mechanism; adopting a hybrid activation function strategy, using the ReLU activation function in layers 1-8 and the h-swish activation function in layers 9-16; and setting a dropout layer with a dropout rate of 0.3 before the Global AveragePooling layer of the classification head. S4. Establish a one-to-one correspondence between the cancer probability value of each image patch and its spatial coordinates and map it back to the full slice spatial scale. In the mapping stage, introduce spatial consistency constraints and neighborhood weighted fusion strategies, and combine Gaussian kernel smoothing to reconstruct the continuous cancer risk distribution. S5. The continuous cancer risk distribution is subjected to threshold adaptive classification to generate multi-level risk regions of low risk, suspicious region and high risk, and the high-risk region is subjected to contour extraction and boundary refinement to obtain the pathological detection results of breast cancer risk.
2. The improved lightweight model for pathological detection of breast cancer risk according to claim 1, characterized in that, In step S1, the tissue region extraction includes: using the V channel brightness distribution to separate the bright background region from the tissue region in order to filter out the slide background and blank areas.
3. The improved lightweight model for pathological detection of breast cancer risk according to claim 1, characterized in that, In step S1, the morphological closing and opening operations are used to fill the pores inside the tissue region and remove isolated noise points.
4. The improved lightweight model for pathological detection of breast cancer risk according to claim 1, characterized in that, In step S2, the effective tissue area is cropped according to a preset size of 256×256 pixels.
5. The improved lightweight model for pathological detection of breast cancer risk according to claim 1, characterized in that, In step S2, each image patch retains its spatial coordinate information in the full slice image.
6. The improved lightweight model for pathological detection of breast cancer risk according to claim 1, characterized in that, In step S3, the ECA mechanism includes: performing global average pooling on the feature map output by the Bottleneck module to generate channel descriptors, and learning the cross-dependencies between channels through 1D convolution to obtain channel attention weights.
7. The improved lightweight model for pathological detection of breast cancer risk according to claim 1, characterized in that, In step S3, the kernel size k of the 1D convolution is adaptively calculated according to the number of channels C, satisfying k=log2(C)+1. The improved lightweight model uses a cross-entropy loss function based on probability output to constrain and optimize the model output during the training phase.
8. The improved lightweight model for pathological detection of breast cancer risk according to claim 1, characterized in that, In step S4, the continuous cancer risk distribution is constructed by combining spatial consistency constraints, neighborhood weighted fusion strategy and Gaussian kernel smoothing to reduce spatial breaks caused by independent prediction.
9. The improved lightweight model for pathological detection of breast cancer risk according to claim 1, characterized in that, In step S5, closed contours are automatically generated for high-risk areas based on the threshold adaptive grading results, and boundary refinement is performed to mark the boundaries of suspected cancerous tissue.
10. A breast cancer risk pathological detection system with an improved lightweight model, characterized in that, include: The preprocessing module is used to acquire whole-slice images of breast tissue pathology (WSI), complete the preliminary localization of tissue regions at low resolution, color space conversion, binarization and morphological processing, and generate tissue region masks. The segmentation module is used to map the tissue region mask back to the original high-resolution layer, establish the pixel coordinate ratio relationship, complete the regular cropping of the effective tissue region, and output the image patch carrying spatial coordinate information. The prediction module, equipped with an improved lightweight model, is used to predict the cancer probability of the input image patch and output the cancer probability value corresponding to each image patch. The improved lightweight model includes: a Bottleneck module replaced with an ECA mechanism, a hybrid activation unit using the ReLU activation function in layers 1-8 and the h-swish activation function in layers 9-16, and a Dropout layer with a dropout rate of 0.3 set before the Global Average Pooling layer of the classification head; The reconstruction module is used to map the cancer probability value of each image patch back to the spatial scale of the whole slice, complete the spatial consistency constraint, neighborhood weighted fusion and Gaussian kernel smoothing, and reconstruct the continuous cancer risk distribution. The output module is used to perform threshold adaptive grading of continuous cancer risk distribution, generate multi-level risk regions, complete the contour extraction and boundary refinement of high-risk regions, and output the pathological detection results of breast cancer risk.