Dual-stage artifact-contrast learning for covert femoral neck fracture ai detection system
By employing a two-stage artifact contrast learning method, this approach addresses the limitations of existing technologies in terms of insufficient sensitivity to occult femoral neck fractures and limited generalization ability in complex multi-center scenarios. It achieves highly sensitive and specific femoral neck fracture detection, thereby improving the efficiency and accuracy of doctors' diagnoses.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- THE SECOND HOSPITAL AFFILIATED TO WENZHOU MEDICAL COLLEGE
- Filing Date
- 2026-06-05
- Publication Date
- 2026-07-03
AI Technical Summary
Existing AI detection technologies for femoral neck fractures are not sensitive enough to occult/non-displaced fractures, have limited generalization ability in complex multi-center scenarios, lack targeted processing of X-ray artifacts and image degradation, and lack systematic multi-center validation and reader-assisted evaluation.
A two-stage artifact contrast learning approach is adopted, which constructs a multi-center cohort through a data acquisition and construction module, an artifact enhancement contrast pre-training module, a detection network fine-tuning module, an inference and visualization module, and a physician-assisted image reading module. Artifact enhancement contrast learning and feature encoder training are carried out, and attention feature aggregation and dynamic upsampling modules are combined to achieve high sensitivity and high specificity detection of femoral neck fractures and provide physician-assisted image reading support.
It improves the sensitivity and specificity of detecting occult femoral neck fractures, enhances multi-center generalization ability, reduces the impact of artifacts on detection, improves the diagnostic efficiency and accuracy of doctors, and meets the stable identification needs under complex multi-center conditions.
Smart Images

Figure CN122335871A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent medical imaging diagnosis technology, specifically to an AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning. Background Technology
[0002] Currently, the standard procedure for emergency trauma patients suspected of having a femoral neck fracture mainly includes: performing an anteroposterior (or hip) X-ray in the emergency department, which is interpreted by a radiologist or clinician; if the X-ray is negative or suspicious but clinically highly suspected of being a fracture, a CT or MRI scan is then performed to confirm or rule out a femoral neck fracture. Previous studies suggest that a high proportion of elderly patients with hip pain and negative or unclear initial X-rays still have radiographically occult surgical hip fractures, often requiring further CT / MRI examinations for definitive diagnosis.
[0003] To improve diagnostic efficiency and accuracy, several deep learning-based automatic detection methods for hip or femoral neck fractures have emerged in recent years. These methods typically employ convolutional neural networks or Transformer architectures to perform binary classification or detection on hip X-ray images and compare the results with those of radiologists. These models are mostly based on backbone networks pre-trained on natural images, trained and validated on single-center or limited multi-center datasets. Some studies have also reported some ability to identify non-displaced or occult fractures. Disadvantages of existing technologies:
[0004] (1) Insufficient sensitivity for occult / non-displaced femoral neck fractures. While existing deep learning models can achieve high AUC in overall fracture detection, their sensitivity is significantly reduced in radiographically occult fractures or non-displaced fracture subtypes such as Garden I-II, resulting in a high risk of missed diagnoses and failing to meet the clinical need for "early and reliable detection of occult fractures".
[0005] (2) Limited generalization ability to complex multi-center conditions. There are significant differences between different hospitals in terms of equipment type, imaging parameters, patient position, and image post-processing. Conventional models are mostly trained on relatively "clean" single-center or small sample data, which is not robust enough to complex situations such as portable X-rays, poor patient position, metal implants and various imaging artifacts. The performance fluctuates significantly during external validation.
[0006] (3) Lack of targeted processing for X-ray artifacts and image degradation. Existing methods usually use pre-trained weights from natural images and do not systematically model and compare common artifacts unique to X-rays, such as grid lines, motion blur, and local overexposure. This results in the model being sensitive to artifacts and having insufficient ability to recognize hidden signs such as minor trabecular bone interruptions and discontinuities in cortical lines.
[0007] (4) Lack of systematic multi-center validation and reader-assisted evaluation. Many studies only report the performance of the model on a single validation set, lacking large-sample validation in multiple independent external centers; at the same time, there is a lack of standardized, multi-reader, multi-case systematic evaluation on whether AI as an auxiliary tool can actually improve the diagnostic sensitivity, specificity and reading efficiency of doctors at different levels.
[0008] In summary, there is an urgent clinical need for an AI-based detection and assisted diagnosis system that maintains high sensitivity and specificity for occult femoral neck fractures in multi-center and multi-condition settings, and can effectively improve the diagnostic efficiency of doctors. Summary of the Invention
[0009] The purpose of this invention is to provide an AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning, in order to solve the problems mentioned in the background art, such as insufficient sensitivity of existing AI detection technologies for occult / non-displaced fractures, limited generalization ability in complex multi-center conditions, lack of targeted processing of X-ray artifacts and image degradation, and lack of systematic multi-center verification and reader-assisted evaluation.
[0010] To achieve the above objectives, the present invention provides the following technical solution:
[0011] A two-stage artifact contrast learning-based AI detection system for occult femoral neck fractures includes a data acquisition and construction module, an artifact enhancement contrast pre-training module, a detection network fine-tuning module, an inference and visualization module, and a physician-assisted image reading module. These modules work together to achieve highly sensitive and specific detection of occult femoral neck fractures. The specific implementation process is as follows:
[0012] S1: The data acquisition and construction module collects continuous anteroposterior pelvic X-ray images and accompanying simultaneous hip CT or MRI images from emergency trauma patients in multiple medical institutions as the gold standard. The training set, internal test set and several independent external test sets are divided by inclusion and exclusion criteria.
[0013] S2: The artifact enhancement contrast pre-training module constructs enhanced image pairs containing various X-ray artifacts based on the internal training set, and obtains a radiographic feature encoder that is insensitive to artifacts through contrastive learning training;
[0014] S3: The detection network fine-tuning module uses the feature encoder as the backbone to construct a single-stage target detection network adapted to the anatomical structure of the femoral neck, and adds an attention feature aggregation module and a dynamic upsampling module to perform fine detection of signs of small fractures in the femoral neck.
[0015] S4: The reasoning and visualization module performs fast reasoning on the input pelvic X-ray image, outputs the probability of the presence of femoral neck fracture and the localization box, and generates a multi-scale attention or class activation heatmap.
[0016] S5: The physician-assisted image reading module embeds the model output into the PACS or image reading workstation interface, providing real-time decision support for radiologists and emergency physicians, and recording diagnostic results and image reading time to evaluate the AI-assisted effect.
[0017] Preferably, the artifact enhancement contrast pre-training module presets 14 common clinical artifact types for X-rays, including grid line artifacts, guide wire artifacts, global motion blur, local motion blur, local overexposure, local saturation, and noise contamination. The artifact simulation and image pairing process involves randomly superimposing one or more of the aforementioned artifacts onto the original pelvic X-ray image to form paired samples of the original image and the artifact image. The contrastive learning training process uses a contrastive loss function to achieve feature optimization, and the expression of the contrastive loss function is:
[0018] ;
[0019] Where f(x) represents the feature encoding result of the original image x, f(x) θ ) represents the feature encoding result of the original image x after perturbation by the artifact θ, simc(·,·) represents the cosine similarity calculation function, τ represents the temperature coefficient, with a value ranging from 0.01 to 0.1, and y represents other case images different from x. θ This represents the image of case y after perturbation by the artifact θ.
[0020] Preferably, the Attention Feature Aggregation (AIFI) module in the detection network fine-tuning module enhances fracture-related structural features and suppresses background interference by adaptively assigning weights and fusing features across layers of the feature pyramid network. The specific implementation formula is as follows:
[0021] ;
[0022] ;
[0023] ;
[0024] Among them, F l This represents the original feature map at level l of the feature pyramid, where L represents the total number of levels in the feature pyramid. ω represents the feature map after channel attention weighting in layer l, ⊕ represents the feature vector concatenation operation, Cnv1dc(·) represents the one-dimensional convolution operation, GlabalAvgPl(·) and GlabalMaxPl(·) represent the global average pooling and global max pooling operations, respectively, MLP(·) represents the multilayer perceptron, and ω l Cnv2d(·) represents the adaptive weights of the l-th layer features during cross-layer fusion, and F represents the two-dimensional convolution operation. agg This represents the final fused feature map after aggregation.
[0025] Preferably, the dynamic upsampling module DySample in the detection network fine-tuning module achieves adaptive interpolation of key pixels through learned sampling weights. The sampling weight calculation formula is as follows:
[0026] ;
[0027] ;
[0028] Among them, F lw Represents a low-resolution feature map, ▽F lw F represents lw The Sbel gradient plot, where Cat(·) represents the channel concatenation operation, Cnv2d(·) represents the 2D convolution operation, σ(·) represents the Sigmid activation function, and W i,j Let Ω represent the sampling weight matrix at position (i,j) in the output feature map, and F represent the sampling neighborhood. up This represents the high-resolution feature map after upsampling.
[0029] Preferably, the multi-center cohort constructed by the data acquisition and construction module includes a training set, an internal test set, and three external test sets. Cases are divided into a femoral neck fracture group and a non-fracture control group based on CT / MRI results. Radiographically occult femoral neck fracture is defined as a case where the initial X-ray report does not provide a clear fracture description and further CT / MRI examination is recommended. Subsequent CT / MRI confirms it as a Garden I–II type femoral neck fracture. The case allocation ratio of the training set, internal test set, and external test set is 7:1:2, and each dataset contains image data with different equipment types, imaging parameters, and patient positions.
[0030] Preferably, the side discrimination automatic determination algorithm in the reasoning and visualization module includes two steps: the first step calculates the black area ratios (Rleft and Rright) of the left and right halves of the entire image, and the formula for calculating the black area ratio is:
[0031] ;
[0032] Where I represents the grayscale value of an image pixel, T represents the black pixel threshold with a value of 10, and Num(·) represents the pixel counting function; the second step combines the horizontal coordinate x of the center point of the detection box. c Correct the side determination result when < And R left >R right It was determined to be the left femoral neck. > And R right >R leftThe image was identified as the right femoral neck, and W represents the image width.
[0033] Preferably, the high-precision attention visualization algorithm within the detection box of the reasoning and visualization module is implemented as follows: the importance map output by the multi-layer dynamic upsampling module is uniformly interpolated to the same size as the original image, and the comprehensive attention distribution is obtained after normalization and Gaussian blurring. The normalization formula is:
[0034] ;
[0035] Where A(i,j) represents the value at position (i,j) in the original attention map, A nrm (i,j) represents the normalized attention value; an attention sub-image is extracted from the detection box and its surrounding area, and the mean μ and standard deviation σ of the sub-image are calculated. Attention levels are divided according to four threshold levels: μ+0.5σ, μ+σ, μ+1.5σ, and μ+2σ. These are drawn with cyan, yellow, orange, and red dots with corresponding different transparency and radius. High-level attention points are superimposed with a halo effect to form a colored attention scattering band.
[0036] Preferably, the fracture risk level output by the reasoning and visualization module is based on the existence probability P, and the specific classification rule is as follows:
[0037] A value of P ≥ 0.85 indicates a high risk.
[0038] When 0.70 ≤ P < 0.85, it is judged as medium risk;
[0039] When 0.38 ≤ P < 0.70, it is considered low risk;
[0040] A P < 0.38 indicates no clear signs of fracture.
[0041] The positioning frames are colored red, orange, green, and gray, respectively. The semi-transparent label on the upper edge of the positioning frame contains information on the side, suspected fracture description, risk level, and confidence percentage.
[0042] Preferably, the report generation function of the physician-assisted image reading module includes single-image structured report generation and batch image Excel report generation. The single-image structured report includes patient number, examination time, lesion location, fracture risk level, confidence percentage, and clinical recommendations. The clinical recommendations are dynamically generated according to the risk level.
[0043] The batch image Excel report includes fields for detection results, confidence level, lesion laterality, risk level, and analysis time, and uses borders, center alignment, and conditional fill color format. When there are attention features of the dynamic upsampling module, the report automatically adds an AI attention analysis section to explain the number of attention layers, the meaning of colored pixels, and the multi-scale fusion algorithm.
[0044] Preferably, the detection network fine-tuning module employs joint optimization using multiple loss functions, the expression of which is:
[0045] ;
[0046] Among them, L cls The classification loss is represented using FcalLss, where L... reg The bounding box regression loss is represented by CIULss, where L... cnf The model represents the confidence-based weighted loss, where λ1, λ2, and λ3 are the weight coefficients for each loss, with values ranging from 0.5 to 1.5, and satisfying λ1+λ2+λ3=2.5. The model's inference time on a single pelvic X-ray image is controlled to the order of 10 milliseconds. It is integrated into hospital PACS or emergency image reading terminals through a standard interface, supporting window level and window width adjustment. The window level adjustment range is -100 to 300, and the window width adjustment range is 100 to 400. The adjustment process uses a short-delay aggregation update mechanism to avoid interface lag.
[0047] Compared with the prior art, the beneficial effects of the present invention are:
[0048] (1) The AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning has high sensitivity for occult femoral neck fractures. In a multicenter pooled cohort, the model of this invention achieved an AUC of approximately 0.990 in all cases, with an overall sensitivity of approximately 97.5% and a specificity of approximately 98.8%. In the radiological occult (Garden I–II) fracture subgroup, the sensitivity was approximately 94.7%, significantly higher than the average level of radiologists and emergency physicians, while maintaining high specificity, achieving stable identification of occult fractures.
[0049] (2) The AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning has good multi-center generalization ability. The present invention shows similar high AUC and high sensitivity / specificity on the internal test set and three independent external test sets, indicating that the robustness and transferability of the model under different hospitals, different equipment and different image quality conditions can be effectively improved by artifact-enhanced contrast pre-training and structural optimization.
[0050] (3) This two-stage artifact contrast learning AI detection system for occult femoral neck fractures significantly improves the diagnostic performance and efficiency of physicians. Without AI assistance, the sensitivity of radiologists and emergency physicians for overall fractures is approximately 93.7% and 84.1%, respectively, and the sensitivity for occult fractures is approximately 86.0% and 68.5%, respectively. With the assistance of the system of this invention, the overall sensitivity and the sensitivity for occult fractures are significantly improved. For example, the sensitivity of emergency physicians for occult fractures is increased to approximately 91.4%, while the average image reading time is reduced by approximately 19.0% and 25.4%, respectively, which significantly improves the efficiency of emergency diagnosis and treatment and reduces the risk of missed diagnosis.
[0051] (4) The robustness of this two-stage artifact contrast learning AI detection system for occult femoral neck fractures is enhanced against artifacts and complex conditions. Thanks to the various X-ray artifact simulations introduced in the first-stage contrast learning, this invention can still maintain stable fracture recognition capabilities under complex conditions such as motion blur, grid artifacts, and local overexposure, reducing misjudgments caused by poor image quality.
[0052] (5) The real-time inference and interpretability of this two-stage artifact contrast learning AI detection system for occult femoral neck fractures support clinical deployment. The inference time of the model on a single image is in the millisecond range, meeting the real-time use requirements of emergency departments; combined with multi-scale attention heatmaps or activation maps, it can provide doctors with intuitive model attention areas, enhancing clinical trust in and interpretability of AI results. Attached Figure Description
[0053] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are explained in detail together with the embodiments of the invention, but do not constitute a limitation thereof.
[0054] Figure 1 This is a system composition block diagram of the present invention;
[0055] Figure 2 This is a flowchart illustrating the specific implementation process of the present invention;
[0056] Figure 3 This is a distribution of common artifact types in X-ray images of the present invention;
[0057] Figure 4 This is a comparison chart of model performance indicators in embodiments of the present invention;
[0058] Figure 5 This is a chart showing the risk grading thresholds for Al diagnosis in an embodiment of the present invention. Detailed Implementation
[0059] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0060] Example
[0061] The technical solution of this embodiment:
[0062] 1. Specific Plan
[0063] (1) Overall architecture
[0064] This embodiment proposes a two-stage artifact contrast learning-based AI detection system for occult femoral neck fractures, including:
[0065] ① Data acquisition and construction module: Collect continuous anteroposterior pelvic X-ray images from emergency trauma patients in multiple medical institutions, along with simultaneous hip CT or MRI imaging reports, as the gold standard; and form a training set, an internal test set, and several independent external test sets by inclusion / exclusion criteria.
[0066] ② Artifact Enhancement Contrast Pre-training Module (Phase 1): Based on the internal training set, it constructs enhanced image pairs containing various X-ray artifacts for contrastive learning, learning radiological feature representations that are insensitive to artifacts.
[0067] ③ Detection Network Fine-tuning Module (Phase Two): Using the encoder pre-trained in Phase One as the backbone, a single-stage target detection network adapted to the anatomical structure of the femoral neck is constructed, and an attention feature aggregation module and a dynamic upsampling module are added to perform fine detection of signs of minor femoral neck fractures.
[0068] ④ Reasoning and Visualization Module: Performs rapid reasoning on the input pelvic X-ray image, outputs the probability of femoral neck fracture and its location box, and generates multi-scale attention or class activation heatmaps to help doctors understand the basis of model interpretation.
[0069] ⑤ Physician-assisted image reading module: The model output is embedded into the PACS or image reading workstation interface to provide real-time decision support for radiologists and emergency physicians, and to record diagnostic results and image reading time for evaluating the effectiveness of AI assistance.
[0070] (2) Dataset construction and definition of occult fracture
[0071] This embodiment selects multicenter anteroposterior pelvic X-ray data and corresponding CT / MRI reports to construct a multicenter cohort including a training set, an internal test set, and three external test sets. Using CT / MRI results as the reference standard, cases are divided into a femoral neck fracture group and a control group without fractures. The operational definition of radiologically occult femoral neck fracture is: an initial X-ray report does not provide a clear fracture description but recommends further CT / MRI examination, and subsequent CT / MRI confirms a Garden I–II femoral neck fracture. This definition ensures that this embodiment focuses on modeling and evaluating occult fractures, a type of fracture most easily missed in clinical practice.
[0072] (3) Stage 1: Contrast learning pre-training based on artifact enhancement
[0073] This embodiment constructs a pre-trained dataset for artifact enhancement contrast based on the internal training set. Its core steps include:
[0074] 1) Artifact type design: For common clinical X-ray image degradation factors, multiple artifact types are pre-set, such as grid / lead artifacts, global or local motion blur, local overexposure or saturation, noise pollution, etc., with a total of several (e.g., 14) simulated artifact types designed.
[0075] 2) Artifact simulation and image pairing: Randomly superimpose one or more of the above artifacts onto the original pelvic X-ray image to form original image-artifact image pairing samples, enabling the model to learn the ability to maintain the same structural semantic representation under artifact interference during the contrastive learning process.
[0076] 3) Contrastive learning training: Using a contrastive loss function, the original-artifact pairs of the same case are brought closer together, while the pairs of different cases are pushed further apart, thereby obtaining a radiographic feature encoder that is invariant to artifacts.
[0077] Through the above steps, the feature extraction network trained in Phase 1 can maintain stable anatomical and pathological information expression under conditions of artifacts, different devices, and different image quality, providing robust initialization for subsequent detection tasks.
[0078] (4) Stage 2: Single-stage detection network combining attention and dynamic upsampling
[0079] In Phase Two, this embodiment uses the encoder obtained in Phase One as initialization to construct a single-stage target detection model suitable for femoral neck fracture detection, which mainly includes:
[0080] 1) Baseline detection network: A single-stage detection architecture based on the YL family is adopted, and the network structure is adjusted for the femoral neck and surrounding pelvic structures to match the receptive field of the feature layer with the anatomical scale of the femoral neck.
[0081] 2) Attention-guided feature aggregation module (AIFI): An attention-guided feature aggregation module is introduced into the feature pyramid network to strengthen the weights of structures related to fracture, such as cortical continuity interruption, trabecular disorder, and abnormal contour lines, and suppress background and irrelevant tissue interference, thereby improving the sensitivity to occult and subtle fracture signs.
[0082] 3) Dynamic upsampling module (DySample): In the top-down feature fusion and upsampling process, a learned sampling weight is introduced to achieve adaptive interpolation of key pixels, so as to preserve the texture details of the femoral neck cortex line and trabecular bone to the maximum extent and avoid the loss of details caused by traditional fixed interpolation.
[0083] 4) Detection head simplification and optimization: Remove detection heads that are too shallow, have too high resolution and are prone to false positives, and retain only the mid-to-high-level detection heads that match the target scale of the femoral neck, so as to reduce false detections caused by small structure noise and reduce the computational load of the model.
[0084] 5) Joint optimization of multiple loss functions: A joint objective including classification loss, bounding box regression loss and confidence-based weighted loss is adopted to improve the overall detection performance of the model on different fracture types and different center data.
[0085] (5) Multicenter training and evaluation process
[0086] This embodiment completes two-stage training on the main training set, and then evaluates the model performance on the internal test set and three external test sets. Furthermore, it compares the model output with 5-point confidence scores from five radiologists and five emergency physicians to evaluate: the model's AUC, sensitivity, and specificity in the overall cohort and the subgroups of occult fractures (Garden I–II) and displaced fractures (Garden III–IV); the model's generalization consistency on multi-center data; and the improvement in sensitivity, specificity, sensitivity to occult fractures, and average reading time for different readers in AI-assisted image reading scenarios. Statistical analysis uses RC curves and the DeLng method to estimate AUC and 95% confidence intervals. The variability of repeated training of multiple models is modeled using a t-distribution, and the difference in performance before and after AI assistance is evaluated using paired t-tests for readers.
[0087] (6) Reasoning and clinical deployment
[0088] In this embodiment, the inference time on a single pelvic X-ray image can be controlled to the order of approximately 10 milliseconds. It can be integrated into hospital PACS or emergency reading terminals through a standard interface to achieve: automatically providing fracture probability prompts and location boxes for suspected femoral neck fracture cases; and providing highly sensitive second interpretation opinions for radiologically concealed cases.
[0089] Displaying activation heatmaps or multi-scale attention heatmaps helps doctors understand the areas of interest the model focuses on. Through this deployment method, this embodiment can provide real-time, interpretable femoral neck fracture detection and auxiliary diagnostic services to clinicians without adding extra radiation or examination procedures.
[0090] (7) System software implementation and human-computer interaction interface
[0091] The intelligent diagnostic model for femoral neck fractures in this embodiment is deployed in a software suite, v1.0, of an AI-powered medical diagnostic system for occult femoral neck fractures, running on a medical workstation or a regular computer terminal. This software is written in Pythn and built upon a deep learning framework and graphical user interface library. It includes the following functional modules:
[0092] 1. Startup and Configuration Module
[0093] A splash screen is used to display progress bars and status prompts in stages during the loading of core modules, initialization of the AI engine, and configuration of the diagnostic system, thereby improving the user-friendliness of human-computer interaction.
[0094] On the left side of the main interface, you can set configuration items such as AI model path, X-ray image path / folder, and output directory. Users can select weight files (.pt), single images, or image folders through the file dialog box. It also supports saving / loading JSN format configuration files, enabling one-click reuse of parameters such as model path and interface language.
[0095] 2. Image window level / width adjustment module
[0096] Set window level (WL), window width (WW) sliders, and various preset window level buttons such as bone window, soft tissue window, and lung window.
[0097] The original X-ray image grayscale is normalized to the range of [0,100]. Based on this, the upper and lower thresholds are calculated according to WL / WW, and the image is linearly stretched and truncated to generate an adjusted image that is more favorable to the contrast of the bone cortex and trabeculae.
[0098] By employing a timer and a fast preview algorithm, we avoid interface lag caused by frequent refreshes. Specifically, we use short-delay aggregation updates when the user drags the slider, calculate the latest parameters only once, and update the display in the real-time preview window on the right, thus balancing smooth interaction and display accuracy.
[0099] 3. Real-time preview and view switching module
[0100] The right side of the main interface is a large image display area, which by default displays the anteroposterior X-ray image of the pelvis after window level / width adjustment, and automatically scales according to the interface size.
[0101] Set up an image / report view switching button in the same area: After completing the AI analysis, users can switch between the image view (displaying detection boxes and attention scatter points) and the diagnostic report view (displaying structured text reports) with one click without opening an additional window.
[0102] The top title bar displays the software name, subtitle, and language switch button.
[0103] 4. Bilingual (Chinese and English) interface module
[0104] The built-in LANGUAGES dictionary allows for the maintenance of both Chinese and English text resources for titles, buttons, prompts, report fields, and more.
[0105] When switching languages, the window title, menu text, button labels, system information, and report templates are dynamically refreshed. At the same time, the terminology for left / right highly suspicious / moderately suspicious is automatically switched in image annotation to ensure language consistency throughout the interface and facilitate use in different countries and regions.
[0106] 5. Singleton / Batch Diagnostics Module
[0107] Single image analysis mode: After the user selects an X-ray film, they can click to start AI diagnosis. The system will use the image processed at the current window level as input to call the deep learning detection model and output the probability of fracture, the side of the lesion, and the location box.
[0108] Batch analysis mode: After the user selects a folder containing multiple X-ray images, the software traverses the image files in an independent thread, calls the AI model for each image and records the results; during the diagnosis process, the status bar displays in real time that batch processing is in progress (current / total)..., the interface will not freeze, which is convenient for clinical batch screening.
[0109] 6. Report generation and export module
[0110] For a single image, the system automatically generates a structured medical report, which includes the patient number (automatically parsed from the file name), examination time, lesion location, AI-suggested fracture risk level, confidence percentage, and corresponding clinical recommendations.
[0111] For batch analysis results, the system calls the table processing library to generate an Excel report with a header row, borders, center alignment, and conditional fill color. The report records the detection result (positive / negative / failure), confidence level, lesion side, risk level, analysis time, and other fields for each image, which is convenient for clinical archiving and scientific research statistics.
[0112] 7. System Information and Risk Classification Module
[0113] The system information area in the lower left corner displays the AI model loading status and the current risk threshold setting in real time, such as: high risk (confidence level ≥ 0.85), medium risk (confidence level ≥ 0.70), and low risk (confidence level ≥ 0.38).
[0114] The risk grading rules are consistent with the colors and text descriptions used in image labels, text reports, and Excel reports, ensuring that the risk expression throughout the system is consistent and traceable.
[0115] 8. Model loading and feature hooking mechanism
[0116] When initializing the MedicalAIAnalyzer object, the software reads the specified YL series detection model weights and registers forward propagation hook functions for specific network layers (such as feature pyramid layers and DySample dynamic upsampling layers).
[0117] During the detection process, the hook function captures the output feature maps of each layer in real time, and calculates multi-scale importance maps using indicators such as channel standard deviation, channel mean, channel maximum value, and Sbel gradient magnitude, thereby obtaining attention distribution information related to the fracture line.
[0118] 9. AI-powered diagnosis and automatic lateral discrimination determination
[0119] For the input image, the model provides candidate detection boxes and their corresponding confidence scores; the system automatically selects the box with the highest confidence score as the diagnosis result.
[0120] To automatically determine whether the femoral neck is on the left or right, this embodiment first calculates the proportion of the black area in the left and right halves of the entire image, and makes a rough judgment using the typical distribution characteristics of the patient's two lower limbs in X-ray films; based on this, the lateral position of the center point of the detection frame is combined to correct the lateral determination, thereby improving the accuracy of the lateral determination.
[0121] 10. High-precision attention visualization algorithm within the detection box
[0122] The importance maps from multiple DySample layers are uniformly interpolated to a heatmap of the same size as the original image, and then normalized and Gaussian blurred to obtain the overall attention distribution of the entire image.
[0123] Attention submaps are extracted only in the detection box and its surrounding area, and the mean and standard deviation of the region are calculated. Different attention levels are divided according to multi-level thresholds (e.g., mean + 0.5 to 2 times the standard deviation).
[0124] Inside the detection box, a limited number of pixels are randomly sampled based on the attention intensity. Filled dots with different radii are drawn using different colors such as red, orange, yellow, and cyan, with varying transparency. A halo effect is then applied to the high-level attention points.
[0125] Using the above method, a colored attention scattering band that is highly consistent with the clinical fracture line morphology is presented in the image preview area. This highlights the fracture area that the model is most concerned about, while avoiding the obscuring of original X-ray details by traditional heatmaps, thus significantly improving interpretability and clinical readability.
[0126] 11. Overlay display and text annotation of diagnostic results
[0127] The femoral neck region detected by the model is marked on the image with a highlighted rectangle. The color of the rectangle is set according to the risk level, with high-risk color (e.g., red), medium-risk color (e.g., orange), and low-risk color (e.g., green).
[0128] Draw a semi-transparent label on the upper edge of the box. The label content includes information such as the risk level of suspected left / right femoral neck fracture, confidence percentage, etc., and supports both Chinese and English formats.
[0129] By using a triple overlay of attention points, risk color boxes, and label text, doctors can intuitively understand the location and severity of lesions indicated by the model within seconds.
[0130] 12. Automatic generation of structured medical reports
[0131] After diagnosis, the program automatically generates textual examination findings and treatment recommendations based on confidence level and risk stratification strategy:
[0132] When the confidence level is ≥0.85, the report concludes that there is a highly suspicious femoral neck fracture and recommends immediate CT / MRI and orthopedic emergency consultation.
[0133] When the confidence level is between 0.70 and 0.85, it is recommended to further CT or MRI for clarification, and make a comprehensive judgment in conjunction with clinical symptoms;
[0134] When the confidence level is between 0.38 and 0.70, close follow-up or re-examination of imaging is recommended;
[0135] When no obvious fracture is detected, it indicates that no clear signs of fracture have been found, and further specialist evaluation is required if the pain persists.
[0136] If DySample attention features are present, an AI attention analysis / TechnicalNates section will be automatically added to the report, explaining the number of attention layers, the meaning of colored pixels, and the multi-scale fusion algorithm, forming a complete report that combines clinical decision-making and technical explanation.
[0137] The AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning has the following advantages:
[0138] (1) High sensitivity for occult femoral neck fractures. In a multicenter pooled cohort, the model of this invention achieved an AUC of approximately 0.990 in all cases, with an overall sensitivity of approximately 97.5% and a specificity of approximately 98.8%. In the radiological occult (Garden I–II) fracture subgroup, the sensitivity was approximately 94.7%, significantly higher than the average level of radiologists and emergency physicians, while maintaining high specificity, achieving stable identification of occult fractures.
[0139] (2) Good multi-center generalization ability. The present invention shows similar high AUC and high sensitivity / specificity on the internal test set and three independent external test sets, indicating that the robustness and transferability of the model under different hospitals, different equipment and different image quality conditions can be effectively improved by artifact enhancement contrast pre-training and structure optimization.
[0140] (3) Significantly improves doctors' diagnostic performance and efficiency. Without AI assistance, the sensitivity of radiologists and emergency physicians to overall fractures is approximately 93.7% and 84.1%, respectively, and the sensitivity to occult fractures is approximately 86.0% and 68.5%, respectively. With the assistance of the system of this invention, the overall sensitivity and the sensitivity to occult fractures are significantly improved. For example, the sensitivity of emergency physicians to occult fractures is increased to approximately 91.4%, while the average image reading time is reduced by approximately 19.0% and 25.4%, respectively, which significantly improves the efficiency of emergency diagnosis and treatment and reduces the risk of missed diagnosis.
[0141] (4) Enhanced robustness to artifacts and complex conditions. Thanks to the simulation of various X-ray artifacts introduced in the phase one contrastive learning, the present invention can still maintain stable fracture recognition ability under complex conditions such as motion blur, grid line artifacts, and local overexposure, reducing misjudgments caused by poor image quality.
[0142] (5) Real-time inference and interpretability support clinical deployment. The inference time of the model on a single image is in the millisecond range, which meets the real-time use requirements of emergency departments; when combined with multi-scale attention heatmaps or activation maps, it can provide doctors with intuitive model attention areas, enhancing clinical trust in AI results and interpretability.
[0143] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A two-stage artifact contrast learning-based AI detection system for occult femoral neck fractures, characterized in that, The system includes modules for data acquisition and construction, artifact enhancement and contrast pre-training, detection network fine-tuning, inference and visualization, and physician-assisted image interpretation. These modules work together to achieve highly sensitive and specific detection of occult femoral neck fractures. The specific implementation process is as follows: S1: The data acquisition and construction module collects continuous anteroposterior pelvic X-ray images and accompanying simultaneous hip CT or MRI images from emergency trauma patients in multiple medical institutions as the gold standard. The training set, internal test set and several independent external test sets are divided by inclusion and exclusion criteria. S2: The artifact enhancement contrast pre-training module constructs enhanced image pairs containing various X-ray artifacts based on the internal training set, and obtains a radiographic feature encoder that is insensitive to artifacts through contrastive learning training; S3: The detection network fine-tuning module uses the feature encoder as the backbone to construct a single-stage target detection network adapted to the anatomical structure of the femoral neck, and adds an attention feature aggregation module and a dynamic upsampling module to perform fine detection of signs of small fractures in the femoral neck. S4: The reasoning and visualization module performs fast reasoning on the input pelvic X-ray image, outputs the probability of the presence of femoral neck fracture and the localization box, and generates a multi-scale attention or class activation heatmap. S5: The physician-assisted image reading module embeds the model output into the PACS or image reading workstation interface, providing real-time decision support for radiologists and emergency physicians, and recording diagnostic results and image reading time to evaluate the AI-assisted effect.
2. The AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning according to claim 1, characterized in that, The artifact enhancement contrast pre-training module presets X-ray artifact types including common clinical artifacts such as raster artifacts, conductor artifacts, global motion blur, local motion blur, local overexposure, local saturation, and noise contamination. The artifact simulation and image pairing process involves randomly superimposing one or more of the aforementioned artifacts onto the original pelvic X-ray image to form paired samples of the original image and the artifact image. The contrastive learning training process uses a contrastive loss function to achieve feature optimization. The expression of the contrastive loss function is: ; Where f(x) represents the feature encoding result of the original image x, f(x) θ ) represents the feature encoding result of the original image x after perturbation by the artifact θ, sim(·,·) represents the cosine similarity calculation function, τ represents the temperature coefficient, with a value ranging from 0.01 to 0.1, and y represents other case images different from x. θ This represents the image of case y after perturbation by the artifact θ.
3. The AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning according to claim 1, characterized in that, The Attention Feature Aggregation (AIFI) module in the detection network fine-tuning module enhances fracture-related structural features and suppresses background interference by adaptively assigning weights and fusing features across layers of the feature pyramid network. The specific implementation formula is as follows: ; ; ; Among them, F l This represents the original feature map at level l of the feature pyramid, where L represents the total number of levels in the feature pyramid. ω represents the feature map after channel attention weighting in layer l, ⊕ represents the feature vector concatenation operation, Cnv1dc(·) represents the one-dimensional convolution operation, GlabalAvgPl(·) and GlabalMaxPl(·) represent the global average pooling and global max pooling operations, respectively, MLP(·) represents the multilayer perceptron, and ω l Cnv2d(·) represents the adaptive weights of the l-th layer features during cross-layer fusion, and F represents the two-dimensional convolution operation. agg This represents the final fused feature map after aggregation.
4. The AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning according to claim 1, characterized in that, The dynamic upsampling module DySample in the detection network fine-tuning module achieves adaptive interpolation of key pixels through learned sampling weights. The formula for calculating the sampling weights is as follows: ; ; Among them, F lw Represents a low-resolution feature map, ▽F lw F represents lw The Sbel gradient plot, where Cat(·) represents the channel concatenation operation, Cnv2d(·) represents the 2D convolution operation, σ(·) represents the Sigmid activation function, and W i,j Let Ω represent the sampling weight matrix at position (i,j) in the output feature map, and F represent the sampling neighborhood. up This represents the high-resolution feature map after upsampling.
5. The AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning according to claim 1, characterized in that, The multi-center cohort constructed by the data acquisition and construction module includes a training set, an internal test set, and three external test sets. Cases are divided into a femoral neck fracture group and a non-fracture control group based on CT / MRI results. Radiographically occult femoral neck fracture is defined as a case where the initial X-ray report does not provide a clear fracture description and further CT / MRI examination is recommended, and subsequent CT / MRI confirms it as a Garden I–II type femoral neck fracture. The case allocation ratio of the training set, internal test set, and external test set is 7:1:2, and each dataset contains image data with different equipment types, imaging parameters, and patient positions.
6. The AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning according to claim 1, characterized in that, The side discrimination automatic determination algorithm in the inference and visualization module includes two steps: the first step is to calculate the proportion of black areas in the left and right halves of the entire image. and The formula for calculating the proportion of the black area is: ; Where I represents the grayscale value of an image pixel, T represents the black pixel threshold with a value of 10, and Num(·) represents the pixel counting function; the second step combines the horizontal coordinate x of the center point of the detection box. c Correct the side determination result when < And R left >R right It was determined to be the left femoral neck. > And R right >R left The image was identified as the right femoral neck, and W represents the image width.
7. The AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning according to claim 1, characterized in that, The high-precision attention visualization algorithm within the detection box of the inference and visualization module is implemented as follows: the importance map output by the multi-layer dynamic upsampling module is uniformly interpolated to the same size as the original image, and the comprehensive attention distribution is obtained after normalization and Gaussian blurring. The normalization formula is: ; Where A(i,j) represents the value at position (i,j) in the original attention map, A nrm (i,j) represents the normalized attention value; an attention sub-image is extracted from the detection box and its surrounding area, and the mean μ and standard deviation σ of the sub-image are calculated. Attention levels are divided according to four threshold levels: μ+0.5σ, μ+σ, μ+1.5σ, and μ+2σ. These are drawn with cyan, yellow, orange, and red dots with corresponding different transparency and radius. High-level attention points are superimposed with a halo effect to form a colored attention scattering band.
8. The AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning according to claim 1, characterized in that, The fracture risk level output by the reasoning and visualization module is based on the probability of existence P, and the specific classification rule is as follows: A value of P ≥ 0.85 indicates a high risk. When 0.70 ≤ P < 0.85, it is judged as medium risk; When 0.38 ≤ P < 0.70, it is considered low risk; A P < 0.38 indicates no clear signs of fracture. The positioning frames are colored red, orange, green, and gray, respectively. The semi-transparent label on the upper edge of the positioning frame contains information on the side, suspected fracture description, risk level, and confidence percentage.
9. The AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning according to claim 1, characterized in that, The report generation function of the physician-assisted image reading module includes the generation of structured reports for single images and the generation of batch image Excel reports. The structured report for a single image includes the patient number, examination time, lesion location, fracture risk level, confidence percentage, and clinical recommendations. The clinical recommendations are dynamically generated based on the risk level. The batch image Excel report includes fields for detection results, confidence level, lesion laterality, risk level, and analysis time, and uses borders, center alignment, and conditional fill color format. When there are attention features of the dynamic upsampling module, the report automatically adds an AI attention analysis section to explain the number of attention layers, the meaning of colored pixels, and the multi-scale fusion algorithm.
10. The AI detection system for occult femoral neck fractures based on two-stage artifact contrast learning according to claim 1, characterized in that, The detection network fine-tuning module employs joint optimization using multiple loss functions, the expression of which is: ; Among them, L cls The classification loss is represented by Fcal Lss, where L is the classification loss. reg The bounding box regression loss is represented using CIU LSS, where L... cnf The model represents the confidence-based weighted loss, where λ1, λ2, and λ3 are the weight coefficients for each loss, with values ranging from 0.5 to 1.5, and satisfying λ1+λ2+λ3=2.
5. The inference time of the model on a single pelvic X-ray image is controlled to the order of 10 milliseconds. It is integrated into hospital PACS or emergency image reading terminals through a standard interface, supporting window level and window width adjustment. The window level adjustment range is -100 to 300, and the window width adjustment range is 100 to 400. The adjustment process adopts a short-delay aggregation update mechanism to avoid interface lag.