A knowledge graph-based digital photo quality detection and correction method
By using a knowledge graph-based approach combined with deep image feature extraction and multi-objective optimization algorithms, we have achieved accurate extraction and intelligent correction of key area information in digital photographs. This solves the problems of key area information loss and insufficient adaptability in existing technologies, and improves the accuracy and stability of photograph quality control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI COMPASS ELECTRONICS TECH
- Filing Date
- 2026-05-08
- Publication Date
- 2026-07-14
AI Technical Summary
In existing technologies for digital photo acquisition, key area information is easily lost, and there is a lack of adaptability and intelligence, making it difficult to achieve multi-objective optimization processing, resulting in photos that cannot meet high-standard usage requirements.
A knowledge graph-based approach is adopted, which uses deep image feature extraction, key region enhancement, and multi-scale feature fusion, combined with a multi-objective optimization algorithm, to generate an optimal correction strategy, thereby achieving accurate extraction and enhancement of key region information and intelligent correction.
It significantly improves the accuracy and completeness of key area feature extraction, enhances the precision and intelligence level of photo quality verification, can dynamically adjust correction strategies to adapt to different quality defects, and improves the reliability and stability of digital photo acquisition and quality control.
Smart Images

Figure CN122391179A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of graph neural networks and deep learning, and in particular to a method for digital photo quality detection and correction based on knowledge graphs. Background Technology
[0002] With the continuous development of digital management and identity authentication technologies, digital facial photographs play a core role in identity recognition, record management, and security supervision. In high-precision, high-standard digital acquisition environments, photographic acquisition systems not only need to capture images quickly but also ensure that the photographs meet standardized requirements in multiple aspects, including facial pose, expression, key point positions, interocular distance, facial proportions, resolution, color, background, and sharpness. Modern photographic acquisition tasks are characterized by high acquisition frequency, high image resolution, complex processing steps, and strong real-time requirements. The system needs to simultaneously complete facial key point localization, key area feature extraction, local and global information fusion, and comprehensive evaluation of multiple quality indicators to ensure that digital photographs meet the high-quality requirements of identity management and automated record construction.
[0003] While some existing technologies can perform basic facial landmark detection and local feature verification, significant shortcomings remain, including limited analytical dimensions, lack of joint processing of local features and overall facial structure, and insufficient multi-objective optimization capabilities. In situations with uneven lighting, partial occlusion, or complex backgrounds, key area information is easily lost, resulting in captured photos that fail to meet high-standard usage requirements. Furthermore, existing methods lack systematic modeling of the relationships between facial features, quality defects, and correction strategies. Photo correction typically relies on manual rules or simple threshold judgments, lacking adaptability and intelligent capabilities, making it difficult to achieve optimized processing for different quality issues.
[0004] Therefore, how to provide a knowledge graph-based method for digital photo quality detection and correction is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a knowledge graph-based method for digital photograph quality detection and correction. This invention fully utilizes deep image feature extraction, key region enhancement, multi-scale feature fusion, and multi-objective optimization algorithms, detailing the technical solutions for key region feature extraction, knowledge graph constraint fusion, and intelligent correction strategy generation during digital photograph acquisition and processing. This invention fuses local region features guided by facial key points with global path features, and performs weighted processing based on the weight information of portrait feature nodes, quality defect nodes, defect cause nodes, and correction action nodes in the knowledge graph. Simultaneously, multi-scale spatial processing is applied to the fused features to achieve accurate extraction and enhancement of key region information. Based on this, this invention employs an improved multi-objective genetic algorithm to search for the optimal correction strategy. By refining the Pareto sampling strategy and dynamically adjusting the reference point position using key region weights, it generates a combination of correction actions that simultaneously satisfies multiple quality indicators. This method possesses advantages such as high accuracy in key region feature extraction, intelligent photograph quality verification, strong multi-indicator optimization capabilities, and adaptive correction strategies, providing a high-precision and high-reliability technical means for digital photograph acquisition and quality control.
[0006] A knowledge graph-based digital photograph quality detection and correction method according to an embodiment of the present invention includes:
[0007] The image module acquires a portrait photo to be detected, and the portrait photo is preprocessed, including image size normalization, color space conversion and noise filtering.
[0008] The face detection module is used to locate the face region and obtain the coordinates of key points including the eyes, nose tip, corners of mouth and chin;
[0009] A key region attention map is generated based on the key point coordinates. The key region attention map is then fused with the spatial path features of the BiSeNet network to form key region enhancement features, which are then normalized, multi-scale fusion, and channel correction processed.
[0010] In the feature fusion module of the BiSeNet network, knowledge graph constraints are combined to map the key region enhancement features and the feature nodes, quality defect nodes, defect cause nodes and correction action nodes of the portrait photo to the fused features, and the fused features are weighted according to the region weights generated by the knowledge graph.
[0011] By using the improved NSGA-III algorithm, based on fusion features and knowledge graph constraints, a set of correction candidate actions is generated. The correction order and parameters of each candidate action combination are optimized in multiple objectives to obtain the optimal correction strategy.
[0012] Based on the optimal correction strategy, correction operations are performed on the portrait photos, including brightness adjustment, contrast adjustment, background replacement, standard cropping, and edge smoothing.
[0013] The corrected portrait photos are reviewed to check whether the key point positions, head posture, occlusion, and image quality parameters meet the standard requirements. If they do not meet the standards, the correction strategy is adjusted and the correction operation is repeated until the standards are met.
[0014] Optionally, the preprocessing of the portrait photograph includes:
[0015] The high-definition camera of the photo module captures images of the detected object to obtain portrait photos. During the shooting process, the shooting time, lighting conditions and camera parameters are recorded to form an initial image dataset.
[0016] The portrait photo is subjected to image size normalization processing, the width and height of the image are adjusted to preset pixel values respectively, the aspect ratio is kept unchanged, abnormal sizes are processed, including cropping and padding, and the adjustment parameters are recorded;
[0017] The normalized portrait photo is converted to a color space, converting the RGB image to a standardized HSV color space. The brightness, chroma, and saturation of each channel are standardized. Gaussian filtering is applied to suppress noise in the pixels, and preliminary smoothing is performed on the edge areas.
[0018] Optionally, obtaining the coordinates of key points including the eyes, tip of the nose, corners of the mouth, and chin includes:
[0019] The face detection module scans portrait photos, identifies the bounding box of the face region, including the coordinates of the upper left and lower right corners, records the width, height and position coordinates of the face region in the image, and marks the pixel range information of the bounding box.
[0020] Within the face area, the coordinates of key points such as the eyes, nose tip, mouth corner and chin are located sequentially using a key point detection algorithm to form a set of key point coordinates. The coordinates of each key point include horizontal and vertical pixel values. Key points that may be occluded, have abnormal lighting or are offset are repeatedly detected.
[0021] The set of key point coordinates is standardized by dividing the horizontal and vertical pixel values by the width and height of the face region, respectively, to obtain normalized key point coordinates. Outliers are detected and corrected, and then organized and stored according to key point type.
[0022] Optionally, the formation of key region enhancement features includes:
[0023] A key region attention map is generated based on the set of key point coordinates. The key point coordinates are mapped to the corresponding pixel regions on the image. A neighborhood region around each key point is defined, and a weight value is assigned to each neighborhood region. The weight value is calculated from the importance coefficient of the key point and a preset weight coefficient. At the same time, the boundary neighborhood is interpolated and smoothed to form preliminary key region enhancement features.
[0024] The initial key region enhancement features are fused with the spatial path features of the BiSeNet network. The fusion method includes multiplying the pixel values of the attention map point by point according to the corresponding positions of the channel and the spatial path feature map, summing the weighted features of all key regions, and normalizing the pixels whose values may be out of range after summation.
[0025] The fused features are normalized in the channel dimension, and the numerical range of each channel is standardized to between 0 and 1. The batch normalization algorithm is then applied to smooth the feature map.
[0026] The normalized features are mapped to context path features, and then fused through channel weighting, convolution operations, and a feature fusion module to correct feature biases generated during the fusion process.
[0027] Multi-scale processing is performed in the spatial dimension, and the multi-scale features are weighted and summed with the context path features to generate key region enhancement features, which include local details and global structural information.
[0028] Optionally, the weighting of the fused features based on the region weights generated from the knowledge graph includes:
[0029] Using key region enhancement features as input, the system receives portrait photo feature nodes, quality defect nodes, defect cause nodes, and correction action nodes defined in the knowledge graph, and records the spatial location and attribute information of each node.
[0030] A BiSeNet network is constructed, which consists of a multi-scale feature fusion module, a key point guided attention module, and a graph constraint fusion module. The consistency and integrity of key region features and spatial path features are maintained in each module.
[0031] In the multi-scale feature fusion module, the key region enhancement features and spatial path features are convolved to generate a multi-scale feature map. The convolution path is adaptively selected according to the key point weights. Cross-regional attention interaction fusion is performed on the convolved multi-scale feature map, the residual information is preserved and dynamically weighted, and the fused multi-scale features are subjected to local-global joint normalization processing. At the same time, the neighborhood relationship constraint of key points is established, and the neighborhood pixels are weighted and fused to form the final multi-scale feature sequence.
[0032] In the key point guided attention module, an attention weight map is generated based on the key point coordinates. The key region pixels of the multi-scale feature sequence are weighted, the boundary pixels are interpolated and smoothed, and the neighborhood features are normalized to form a key point guided weighted feature sequence, while retaining the key point position index.
[0033] In the knowledge graph constraint fusion module, knowledge graph node information is mapped to a weighted feature sequence guided by key points, a node-feature mapping matrix is constructed, the features are weighted according to the relationship between nodes and preset coefficients, and the node constraint information is fused through channel weighting, convolution and batch normalization. The fused features are then subjected to outlier detection and correction to generate key region fused features.
[0034] Optionally, obtaining the optimal correction strategy includes:
[0035] Using key region fusion features as input, a candidate correction action set is constructed. Each action includes brightness, contrast, cropping, boundary smoothing and background replacement parameters. The candidate actions are encoded to form an initial population, and the spatial distribution and weight information of the key region features corresponding to each individual are recorded.
[0036] A multi-objective optimization function is defined, and the optimization indicators include key region integrity, facial proportion standard, occlusion region processing, image quality parameters, and correction action coupling degree. The target value is calculated for each individual in the initial population, and the target indicators and weights are recorded.
[0037] Based on the weights of the key region fusion features and the distribution of each candidate correction action individual in the multi-objective index space, an adaptive reference point set is generated, and the coordinates and corresponding weights of the reference points are recorded.
[0038] The initial population is subjected to non-dominated sorting, crowding distance is calculated, and a refined Pareto sampling strategy is combined to preferentially select individuals that match reference points with key region weights exceeding a preset threshold from the Pareto optimal solution set, forming a balanced sampling subset.
[0039] Crossover and mutation operations are performed on the population to generate a new generation of individuals. Crossover adopts a feature-weighted exchange strategy, and mutation combines key region feature perturbation and node weight fine-tuning.
[0040] The new generation of individuals is merged with the previous generation of elite individuals, non-dominated sorting and crowding distance calculation are performed, and the reference point position is dynamically adjusted according to the refined Pareto sampling strategy. The crossover, mutation, sorting and sampling operations are repeated until the preset number of iterations or convergence conditions are reached.
[0041] For the final Pareto frontier individual set, a comprehensive score is calculated based on the key region fusion feature weights and multi-objective indicators to generate the optimal combination of correction actions and parameter set, while recording key region, node mapping and Pareto reference point information.
[0042] The optimal combination of correction actions and parameters are used as output to form an improved optimal correction strategy generated by NSGA-III, while the final correction parameters and key point coordinate information are recorded.
[0043] Optionally, the step of performing the correction operation on the portrait photograph includes:
[0044] According to the optimal correction strategy, the brightness of the portrait photo is adjusted by adding or subtracting the brightness channel values of each pixel in the original image according to the preset adjustment parameters in the optimal correction strategy, and the adjustment parameters and corresponding pixel coordinate information are recorded at the same time.
[0045] Contrast adjustment is performed on portrait photos, and pixel values are mapped according to the linear mapping function in the optimal correction strategy to stretch the image pixel distribution to a preset range. Outlier detection and correction are performed on the mapping results.
[0046] The background replacement operation is performed on portrait photos. The original background area and the candidate background image are overlaid at the pixel level, and then mixed and merged according to the weight map generated by the boundary area.
[0047] Perform standard cropping operations on portrait photos, cropping the image based on key point coordinates and face area positions, and adjusting the image size and proportions to the preset standard size;
[0048] The boundary areas of the portrait photo are smoothed by processing the boundary pixel values using a Gaussian filtering method.
[0049] Optionally, the review of the corrected portrait photograph includes:
[0050] The key point coordinates, head posture, facial occlusion status, and image quality parameters, including brightness, contrast, noise, shadows, and exposure level, are detected in the corrected portrait photos. The detection results are then compared with preset standard thresholds.
[0051] Based on the comparison results, verification markers are generated, and the coordinates of key points or regions that do not meet the standard threshold and their corresponding image quality parameters are recorded to establish a verification dataset.
[0052] The optimal correction strategy is adjusted based on the review marks, and the parameters of brightness, contrast, background replacement, standard cropping and edge smoothing are reconfigured, and the order of correction actions is adjusted as necessary.
[0053] Re-perform brightness adjustment, contrast adjustment, background replacement, standard cropping, and edge smoothing operations on the portrait photo, and update the review data record, including adjustment parameters and corresponding pixel coordinate information;
[0054] Repeat the review and correction operations until all review markers meet the preset standard thresholds, forming the final portrait photo correction result, and record the final correction parameters and key point coordinate information.
[0055] The beneficial effects of this invention are:
[0056] This invention precisely extracts features from key areas of portrait photographs, fuses local features guided by key points with global path features, and weights these fused features using weighted information from portrait feature nodes, quality defect nodes, defect cause nodes, and correction action nodes in a knowledge graph. This achieves effective coupling between key area information and the overall facial structure. During key area enhancement, this invention utilizes attention map generation, neighborhood weight allocation, and multi-scale processing to simultaneously optimize local facial details and global structural information, significantly improving the accuracy and completeness of key area feature extraction.
[0057] This invention employs an improved NSGA-III algorithm, combined with a refined Pareto sampling strategy, to optimize the search for the set of candidate correction actions, achieving parameter optimization for correction operations including brightness, contrast, background replacement, cropping, and edge smoothing. When dealing with uneven lighting, partial occlusion, and complex backgrounds, it can dynamically adjust the weights of key regions and the distribution of reference points, generating an optimal correction strategy that simultaneously considers local details and overall facial structure, effectively improving the accuracy and intelligence level of photo quality verification.
[0058] This invention's method possesses adaptive correction strategy generation capabilities, automatically adjusting the sequence and parameters of correction actions for different quality defects, thus achieving intelligent correction of digital photographs. Compared to traditional methods, this invention exhibits significant advantages in key area feature extraction accuracy, multi-objective optimization capabilities, and intelligent correction levels. It can improve the reliability, stability, and adaptability of digital photograph acquisition and quality control, providing efficient, accurate, and intelligent technical support for identity management, archive construction, and automated digital acquisition systems. Attached Figure Description
[0059] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0060] Figure 1 This is a flowchart of a knowledge graph-based digital photo quality detection and correction method proposed in this invention;
[0061] Figure 2 This is a schematic diagram of the knowledge graph constraint fusion module of the digital photo quality detection and correction method based on knowledge graph proposed in this invention.
[0062] Figure 3 This is a schematic diagram of the improved NSGA-III algorithm, which is a knowledge graph-based digital photo quality detection and correction method proposed in this invention. Detailed Implementation
[0063] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0064] refer to Figure 1 , Figure 2 and Figure 3 A knowledge graph-based method for digital photo quality detection and correction includes:
[0065] The image module acquires a portrait photo to be detected, and the portrait photo is preprocessed, including image size normalization, color space conversion and noise filtering.
[0066] The face detection module is used to locate the face region and obtain the coordinates of key points including the eyes, nose tip, corners of mouth and chin;
[0067] A key region attention map is generated based on the key point coordinates. The key region attention map is then fused with the spatial path features of the BiSeNet network to form key region enhancement features, which are then normalized, multi-scale fusion, and channel correction processed.
[0068] In the feature fusion module of the BiSeNet network, knowledge graph constraints are combined to map the key region enhancement features and the feature nodes, quality defect nodes, defect cause nodes and correction action nodes of the portrait photo to the fused features, and the fused features are weighted according to the region weights generated by the knowledge graph.
[0069] By using the improved NSGA-III algorithm, based on fusion features and knowledge graph constraints, a set of correction candidate actions is generated. The correction order and parameters of each candidate action combination are optimized in multiple objectives to obtain the optimal correction strategy.
[0070] Based on the optimal correction strategy, correction operations are performed on the portrait photos, including brightness adjustment, contrast adjustment, background replacement, standard cropping, and edge smoothing.
[0071] The corrected portrait photos are reviewed to check whether the key point positions, head posture, occlusion, and image quality parameters meet the standard requirements. If they do not meet the standards, the correction strategy is adjusted and the correction operation is repeated until the standards are met.
[0072] In this embodiment, the preprocessing of the portrait photograph includes:
[0073] The high-definition camera of the photo module captures images of the detected object to obtain portrait photos. During the shooting process, the shooting time, lighting conditions and camera parameters are recorded to form an initial image dataset.
[0074] The portrait photo is subjected to image size normalization processing, the width and height of the image are adjusted to preset pixel values respectively, the aspect ratio is kept unchanged, abnormal sizes are processed, including cropping and padding, and the adjustment parameters are recorded;
[0075] The normalized portrait photo is converted to a color space, converting the RGB image to a standardized HSV color space. The brightness, chroma, and saturation of each channel are standardized. Gaussian filtering is applied to suppress noise in the pixels, and preliminary smoothing is performed on the edge areas.
[0076] In this embodiment, obtaining the coordinates of key points including the eyes, nose tip, corners of the mouth, and chin includes:
[0077] A face detection module is used to scan portrait photos, identify the bounding box of the face region, including the coordinates of the top left and bottom right corners, record the width, height, and position coordinates of the face region in the image, and mark the pixel range information of the bounding box, where:
[0078] The face detection module scans portrait photos and identifies the bounding boxes of face regions, specifically:
[0079] The RetinaFace model is used to perform forward inference on the input portrait photo to generate face candidate boxes and corresponding confidence scores.
[0080] The candidate bounding boxes are threshold-filtered to remove regions with a confidence level below 0.5, and retain face regions with a confidence level greater than or equal to 0.5.
[0081] Non-maximum suppression is applied to the retained candidate boxes to remove overlapping regions and determine the final face bounding box position;
[0082] Within the face area, a key point detection algorithm is used to sequentially locate the coordinates of key points such as the eyes, nose tip, mouth corners, and chin, forming a set of key point coordinates. The coordinates of each key point include horizontal and vertical pixel values. Key points that may be occluded, have abnormal lighting, or be offset are repeatedly detected. The key point detection algorithm is as follows:
[0083] Image features are extracted from the face region to generate multi-scale convolutional feature maps;
[0084] Input multi-scale features into the keypoint regression network and output a confidence heatmap for each keypoint.
[0085] Find the location of maximum response in the heat map to determine the initial coordinates of the eyes, tip of the nose, corner of the mouth, and chin;
[0086] The confidence level of the initial key point coordinates is checked. For key points with a confidence level below 0.6 or those that are occluded, feature extraction and coordinate prediction are repeated for iterative correction.
[0087] The final coordinates are locally smoothed, and the horizontal and vertical pixel values are recorded to form a standardized set of key point coordinates.
[0088] The set of keypoint coordinates is standardized by dividing the horizontal and vertical pixel values by the width and height of the face region, respectively, to obtain normalized keypoint coordinates. Outliers are detected and corrected, and the coordinates are organized and stored according to keypoint type.
[0089] Outlier detection and correction are performed as follows:
[0090] Calculate the horizontal and vertical pixel value deviations of each keypoint based on its historical location and the coordinates of adjacent keypoints;
[0091] If the deviation exceeds the preset threshold or the coordinates are outside the reasonable range, the key point will be marked as abnormal.
[0092] For key points marked as anomalies, coordinate correction is performed using neighborhood key point interpolation;
[0093] When there is occlusion or abnormal lighting, the abnormal key points are marked with a confidence level of less than 0.6.
[0094] In this embodiment, the formation of key region enhancement features includes:
[0095] A key region attention map is generated based on the set of keypoint coordinates. The keypoint coordinates are mapped to corresponding pixel regions on the image. A neighborhood region is defined around each keypoint, and a weight value is assigned to each neighborhood region. The weight value is calculated from the importance coefficient of the keypoint and a preset weight coefficient. Simultaneously, interpolation smoothing is performed on the boundary neighborhoods to form preliminary key region enhancement features, wherein:
[0096] Define the neighborhood region surrounding each keypoint, specifically as follows:
[0097] The neighborhood radius is determined based on the size of the face region and the type of key points, with a larger radius set for the eye region and a smaller radius set for the tip of the nose and corners of the mouth.
[0098] Draw a two-dimensional circular region at the center of each key point, mark the pixels in the neighborhood as the coverage area of the key point, and record the horizontal and vertical distances of each pixel from the center of the key point.
[0099] For pixels with overlapping neighborhoods of different key points, record the indexes and distance information of multiple key points corresponding to each pixel;
[0100] The shape and size of the neighborhood are adaptively adjusted according to the spatial position of the key points in the face, and the neighborhood of key points near the edge of the face is reduced;
[0101] The weight value is obtained from the importance coefficient of the key point and the preset weight coefficient, specifically:
[0102] The importance coefficients of key points are determined based on their role in facial recognition and quality inspection. The importance coefficients for the eyes are set at 0.35, the tip of the nose at 0.25, and the corners of the mouth and chin at 0.20 each.
[0103] The preset weight coefficients are calculated based on the distance from the pixel to the center of the key point, using a Gaussian decay function. Pixels closer to the center have higher weights, while pixels farther from the center have lower weights.
[0104] The weights of overlapping pixels in the neighborhood are normalized to ensure that the total weights do not exceed 1, and the key points and weight information corresponding to each pixel are recorded.
[0105] The initial key region enhancement features are fused with the spatial path features of the BiSeNet network. The fusion method includes multiplying the pixel values of the attention map point-by-point according to the corresponding positions of the channel and the spatial path feature map, summing the weighted features of all key regions, and normalizing pixels whose values may be out of range after summation.
[0106] The attention map pixel values are multiplied point-by-point according to the corresponding positions of the channel and the spatial path feature map, specifically:
[0107] The pixel values of the attention map for each key region are mapped to the corresponding positions in the spatial path feature map of the BiSeNet network, with each channel corresponding to the local response of the key region.
[0108] For each pixel position, perform point-by-point multiplication sequentially by channel;
[0109] When processing the neighborhood of multiple key points, for the case where the same pixel belongs to the coverage area of multiple key points, the point-by-point multiplication result is calculated separately and the weights of each are retained.
[0110] Check the multiplication results and mark any possible numerical anomalies or overflows;
[0111] The fused features are normalized in the channel dimension, and the numerical range of each channel is standardized to between 0 and 1. The batch normalization algorithm is then applied to smooth the feature map.
[0112] The normalized features are mapped to context path features, and then fused using channel weighting, convolution operations, and a feature fusion module. Feature biases generated during the fusion process are corrected.
[0113] The normalized features are mapped to context path features, specifically as follows:
[0114] Bilinear interpolation alignment is used based on the spatial size and resolution of the normalized features and the context path features;
[0115] For feature maps with inconsistent sizes, upsampling is used to adjust them to a uniform resolution, while the pixel coordinate mapping relationship is recorded.
[0116] During the mapping process, the original weight distribution of neighboring pixels in key regions is retained, while the initial weight of pixels in non-key regions is set to 0.05.
[0117] The mapped features are rearranged according to channel dimensions to ensure that the channel order is consistent with the context features;
[0118] During the mapping process, the position index of each key region enhancement feature in the context feature map is recorded;
[0119] Multi-scale processing is performed in the spatial dimension, and the multi-scale features are weighted and summed with the context path features to generate key region enhancement features, which include local details and global structural information.
[0120] In this embodiment, the step of weighting the fused features based on the region weights generated from the knowledge graph includes:
[0121] Using key region enhancement features as input, the system receives portrait photo feature nodes, quality defect nodes, defect cause nodes, and correction action nodes defined in the knowledge graph, and records the spatial location and attribute information of each node.
[0122] A BiSeNet network is constructed, which consists of a multi-scale feature fusion module, a key point guided attention module, and a graph constraint fusion module. The consistency and integrity of key region features and spatial path features are maintained in each module.
[0123] In the multi-scale feature fusion module, key region enhancement features and spatial path features are convolved to generate multi-scale feature maps. The convolution path is adaptively selected based on the keypoint weights. Cross-regional attention interaction fusion is performed on the convolved multi-scale feature maps, preserving residual information and dynamically weighting it. Local-global joint normalization is then applied to the fused multi-scale features. Simultaneously, keypoint neighborhood relationship constraints are established, and neighboring pixels are weighted and fused to form the final multi-scale feature sequence, where:
[0124] The convolution path is adaptively selected based on the keypoint weights, specifically as follows:
[0125] Different kernel sizes and channel combinations are assigned based on the importance of key regions in facial recognition and photo quality detection.
[0126] Analyze the local complexity and pixel density of each key region, dynamically select a suitable convolution path, keep the original convolution output of the channels where the pixels in the key regions are located, and perform partial suppression processing on the channels where the pixels in the non-key regions are located.
[0127] During the convolution process, the channel index, kernel size and feature response corresponding to each convolution operation are recorded to form an adaptive convolution output.
[0128] Cross-regional attention interaction fusion is performed on key regional features, specifically as follows:
[0129] The key region pixels in the multi-scale feature map are mapped to the pixels of neighboring key regions. Attention coefficients are calculated in the channel dimension. The pixels in the cross region are weighted and summed. The pixels with repeated coverage are accumulated to generate the fused key region features. At the same time, the spatial index information of each key point in the image is preserved.
[0130] Residual information is retained and dynamically weighted, specifically as follows:
[0131] A residual branch is introduced into the fusion feature, and the original convolution output is added to the cross-region fusion feature element by element. The residual weighting coefficient is adjusted in combination with the key point weights. The original detail information of the pixels in the key region is preserved, and the pixels in the non-key region are appropriately balanced.
[0132] Local-global joint normalization is performed on multi-scale features, specifically as follows:
[0133] For the fused multi-scale feature map, the mean and standard deviation are calculated in two dimensions: the neighborhood of local key points and the entire global image. The feature pixel values are normalized to maintain the relative proportions between scales and the distribution relationship of key region features, thereby generating a multi-scale key region enhanced feature sequence.
[0134] Establish key point neighborhood relationship constraints, specifically as follows:
[0135] In the multi-scale key region enhancement feature sequence, spatial index labels are made for the neighboring pixels around each key point, the distance matrix between the key point and the neighboring pixels is calculated, weighting coefficients are assigned to the neighboring pixels according to the distance matrix, the weight information is combined with the key region enhancement features, the neighboring pixels at different scales are processed separately, and the key point index and weight information corresponding to each neighboring pixel are recorded.
[0136] In the keypoint-guided attention module, an attention weight map is generated based on the keypoint coordinates. Key region pixels in the multi-scale feature sequence are weighted, boundary pixels are interpolated and smoothed, and neighborhood features are normalized to form a keypoint-guided weighted feature sequence. The keypoint position index is retained.
[0137] An attention weight map is generated based on the keypoint coordinates, specifically as follows:
[0138] Each keypoint is mapped to the center position on the image. The neighborhood radius is determined according to the keypoint type and the size of the face region, forming a local pixel set around the keypoint. For each pixel, the weight is initially calculated based on the distance to the center of the keypoint. If the same pixel belongs to the neighborhood of multiple keypoints, the weight accumulation operation is performed, and the keypoint index and corresponding neighborhood number of the pixel are recorded. Abnormal pixel positions are marked, and the spatial position and index information of the keypoint neighborhood are fully recorded to generate an attention weight map, which includes pixel weight values, spatial coordinates and neighborhood mapping information.
[0139] The key region pixels of the multi-scale feature sequence are weighted, specifically as follows:
[0140] Based on the attention weight map, a channel-wise multiplication operation is performed on each channel of the multi-scale feature sequence for each key region pixel. For the case where the same pixel belongs to multiple key point neighborhoods, the weight multiplication results of each neighborhood are calculated separately and then weighted and accumulated. The spatial position, corresponding channel index and weight value of each pixel are recorded.
[0141] In the knowledge graph constraint fusion module, knowledge graph node information is mapped to a weighted feature sequence guided by key points, constructing a node-feature mapping matrix. Features are weighted according to the relationships between nodes and preset coefficients. Node constraint information is then fused through channel weighting, convolution, and batch normalization. Outlier detection and correction are performed on the fused features to generate key region fusion features, where:
[0142] The knowledge graph node information is mapped to a weighted feature sequence guided by key points, specifically as follows:
[0143] Read the spatial location, node type, and attribute information of each node in the knowledge graph, including portrait photo feature nodes, quality defect nodes, defect cause nodes, and correction action nodes;
[0144] Based on the spatial coordinates of the weighted feature sequence guided by key points, each node is mapped to the corresponding pixel region, and the pixel position and channel index of the node are recorded.
[0145] When multiple nodes are mapped to the same pixel, a weighted average is calculated based on node category and neighborhood relationship, retaining the node index and corresponding neighborhood number of each pixel;
[0146] Construct the node-feature mapping matrix as follows:
[0147] The mapped node information and corresponding feature values are organized in matrix form, where the matrix rows represent node indices and the columns represent channel indices in the feature sequence.
[0148] The matrix records the feature channel value, pixel position index, and initial weighting value corresponding to each node, and the node information of shared pixels is merged.
[0149] The features are weighted based on the relationships between nodes and preset coefficients, specifically as follows:
[0150] Read the relationships between nodes, including neighboring nodes, priority of critical nodes, and severity level of defects;
[0151] Based on the relationship between nodes and preset coefficients, the features corresponding to the nodes are weighted and adjusted, and the features of shared pixels are weighted and averaged according to the node weights.
[0152] During the weighting process, the neighboring pixels and boundary pixels of the key region are processed separately, the feature weights are corrected by combining the neighborhood attention information, and abnormal weight values are marked.
[0153] The improved BiSeNet network in this invention is designed based on the traditional BiSeNet network. While retaining the spatial and contextual path branches of the original BiSeNet network, it optimizes the fusion method between convolutional outputs and key region enhancement features, achieving feature normalization and consistency across channels and spatial dimensions. Simultaneously, a multi-scale feature fusion module is added, generating a multi-scale feature sequence by weighted summation of outputs from different convolutional scales, thereby enhancing key region feature information. In the keypoint-guided attention module, the original attention mechanism is improved by mapping attention weights to the key points of the multi-scale feature sequence. The key region pixels are processed by interpolation, smoothing, and normalization of boundary pixels to form a key point-guided weighted feature sequence. In the graph constraint fusion module, the knowledge graph node information is mapped to the key point-guided weighted feature sequence, a node-feature mapping matrix is constructed, and the features are weighted according to the relationship between nodes and preset coefficients. Then, the features are fused through convolution and batch normalization, while correcting outliers to generate key region fused features. The newly added multi-scale feature fusion module, the improved key point-guided attention module, and the graph constraint fusion module are connected to the convolution outputs of the spatial path branch and the context path branch, respectively, to form a complete improved BiSeNet network.
[0154] In this embodiment, obtaining the optimal correction strategy includes:
[0155] Using key region fusion features as input, a candidate correction action set is constructed. Each action includes parameters for brightness, contrast, cropping, boundary smoothing, and background replacement. The candidate actions are encoded to form an initial population, and the spatial distribution and weight information of the key region features corresponding to each individual are recorded.
[0156] The candidate actions are encoded to form the initial population, specifically as follows:
[0157] The brightness, contrast, cropping, edge smoothing, and background replacement parameters of each candidate correction action are arranged in a fixed order to form a feature vector, and each feature vector represents an individual.
[0158] For cases involving multiple action combinations, the feature vectors of each action are sequentially concatenated to form a composite encoding vector, which records the order and parameter information of each action in the sequence.
[0159] During the encoding process, the spatial coordinates of each key region pixel in the key region fusion feature are mapped to the corresponding parameters in the vector, and the weight allocation information of each pixel is recorded to form an initial population dataset containing spatial distribution and weight information.
[0160] A multi-objective optimization function is defined, with optimization metrics including key region integrity, facial proportion standard, occlusion region processing, image quality parameters, and correction of action coupling. The objective value is calculated for each individual in the initial population, and the objective metrics and weights are recorded, where:
[0161] Define a multi-objective optimization function as follows:
[0162] The optimization metrics include key region integrity, facial proportion standard, occlusion area processing, image quality parameters, and corrective action coupling degree. Key region integrity is measured by calculating the key point coordinate deviation and pixel region integrity. Facial proportion standard is quantified by the distance ratio between key points. Occlusion area processing is evaluated by statistically analyzing the proportion of occluded pixels in the key region. Image quality parameters include mean brightness, standard deviation of contrast, image blur, and noise density. Corrective action coupling degree is calculated by the mutual influence and dependence between parameters in the candidate action combination. At the same time, different weight values are assigned to each metric according to the importance of the key region and the preset weight.
[0163] The target value is calculated for each individual in the initial population, specifically as follows:
[0164] For each candidate combination of correction actions, the corresponding key region fusion features are mapped to each optimization index. The values are obtained according to the calculation rules of each index. Then, a weighted sum is performed to generate a comprehensive target value. The original value and weighted value of each individual on each index are recorded. The spatial distribution information of key regions and the corresponding channel index are preserved to form a complete target value dataset.
[0165] Based on the weights of the key region fusion features and the distribution of each candidate correction action in the multi-objective index space, an adaptive reference point set is generated, recording the coordinates and corresponding weights of the reference points, where:
[0166] Generate an adaptive reference point set, specifically as follows:
[0167] Based on the weight distribution of each key region in the key region fusion feature and the distribution of each candidate correction action individual in the multi-objective index space, the reference point position is adaptively determined in the target space according to the weight value.
[0168] Increase the density of reference points in areas where the critical area weight exceeds 0.3, and set reference points at standard distances in areas where the critical area weight is less than 0.1;
[0169] The weight value corresponding to the reference point is obtained by accumulating the pixel weights of the key area covered by each reference point, and the coordinates and weight information of the reference point in the target space are recorded.
[0170] When there is overlap in key areas, the weights of the overlapping reference points are weighted and averaged to form the final adaptive reference point set.
[0171] The initial population is subjected to non-dominated sorting, crowding distance is calculated, and a refined Pareto sampling strategy is used to preferentially select individuals matching reference points whose key region weights exceed a preset threshold from the Pareto optimal solution set, forming a balanced sampling subset, wherein:
[0172] The crowding distance is calculated as follows:
[0173] For individuals after non-dominated sorting, sort them according to the target value in each target dimension and record the difference in target value between adjacent individuals;
[0174] The differences of an individual across all target dimensions are summed to form the overall distance of that individual in the target space;
[0175] For individuals located at the leading edge boundary, set the spacing value to the maximum;
[0176] The differences in target dimensions corresponding to key regions with a weight exceeding 0.3 in the key region fusion features are weighted and processed.
[0177] The refined Pareto sampling strategy is as follows:
[0178] After completing the initial non-dominated sorting of the population and calculating the crowding distance, individuals in the Pareto optimal solution set are matched with reference points in the target space based on the weights of the key region fusion features.
[0179] Individuals corresponding to reference points with a critical region weight exceeding 0.3 are selected first, and then sorted according to their crowding distance in the front layer.
[0180] Within the area covered by reference points with a weight greater than 0.3, individuals are gradually screened, and the number of individuals in different frontier layers is adjusted to ensure that the sampling subset is evenly distributed in the target space while taking into account the importance of key regions.
[0181] Record the spatial coordinates, target value, and corresponding reference point index information of each sampled individual to form a balanced sampling subset;
[0182] Crossover and mutation operations are performed on the population to generate a new generation of individuals. Crossover employs a feature-weighted exchange strategy, while mutation combines key region feature perturbation and node weight fine-tuning.
[0183] The crossover employs a feature-weighted exchange strategy, specifically:
[0184] In the parent individual pair, the channel features of the fusion features of each key region are matched, and the channel-by-channel weighted combination is performed according to the preset weighting ratio of the parent individual feature values. The weighted result is then mapped to the corresponding channel position of the offspring individual.
[0185] During the weighting process, the spatial coordinates, key region index, and channel index of each pixel are recorded, and any possible numerical overflow is normalized.
[0186] The multi-objective metrics of offspring individuals are updated, including key region integrity, facial proportion standards, occlusion processing, image quality parameters, and correction of motion coupling.
[0187] The mutation combines key region feature perturbations with node weight fine-tuning, specifically as follows:
[0188] Random perturbations are introduced into the pixel features of key regions of offspring individuals. The perturbation amplitude is adaptively adjusted according to the weight of the key regions, and the corresponding feature values are fine-tuned according to the weight information of knowledge graph nodes.
[0189] During the processing, special processing is performed on boundary pixels and overlapping key region pixels, and the node mapping and spatial index of each pixel are updated.
[0190] After completing the perturbation and fine-tuning, the multi-objective indicators of the offspring individuals are recalculated, and the characteristic states and reference point indices of all key regions are recorded.
[0191] The new generation of individuals is merged with the previous generation of elite individuals, non-dominated sorting and crowding distance calculation are performed, and the reference point position is dynamically adjusted according to the refined Pareto sampling strategy. The crossover, mutation, sorting and sampling operations are repeated until the preset number of iterations or convergence conditions are reached.
[0192] For the final Pareto frontier set of individuals, a comprehensive score is calculated based on the fusion feature weights of key regions and multi-objective indicators to generate the optimal combination of correction actions and parameter set. Simultaneously, information on key regions, node mappings, and Pareto reference points is recorded, including:
[0193] The comprehensive score is calculated based on the weights of key region fusion features and multi-objective indicators, as follows:
[0194] For each Pareto frontier individual, multi-objective metrics, including key region integrity, facial proportion standard, occlusion region processing, image quality parameters, and correction action coupling degree, are weighted according to the weight of the corresponding key region in the knowledge graph.
[0195] Different target indicators are aggregated according to preset weights to form a single comprehensive score;
[0196] During the weighting and summarizing process, the spatial distribution of pixels in key areas and node mapping are taken into account to ensure that the comprehensive score can fully reflect the importance of key areas.
[0197] For individuals with multiple similar overall scores, further sorting is performed based on reference point matching and key area coverage, prioritizing individuals with a key area coverage weight exceeding 0.3;
[0198] Record the key region index, node mapping information and corresponding reference point index of each individual to form the optimal combination of correction actions and parameter set;
[0199] The optimal combination of correction actions and parameters are used as output to form the optimal correction strategy generated by the improved NSGA-III algorithm, while the final correction parameters and key point coordinate information are recorded.
[0200] In this embodiment, the step of performing a correction operation on the portrait photograph includes:
[0201] According to the optimal correction strategy, the brightness of the portrait photo is adjusted by adding or subtracting the brightness channel values of each pixel in the original image according to the preset adjustment parameters in the optimal correction strategy, and the adjustment parameters and corresponding pixel coordinate information are recorded at the same time.
[0202] Contrast adjustment is performed on portrait photos, and pixel values are mapped according to the linear mapping function in the optimal correction strategy to stretch the image pixel distribution to a preset range. Outlier detection and correction are performed on the mapping results.
[0203] The process involves replacing the background of a portrait photo by overlaying the original background area with the candidate background image pixel-by-pixel, and then blending and merging the images based on a weighted map generated from the boundary regions.
[0204] To replace the background of a portrait photo, the specific steps are as follows:
[0205] The original background region and the candidate background image are superimposed at the pixel level, and each pixel is weighted and mixed according to the weight map generated by the boundary region.
[0206] For boundary pixels near the key region, the mixing ratio is dynamically adjusted based on the weight of the key region fusion features;
[0207] During the processing, for overlapping pixels or pixels where multiple key regions intersect, a weighted average is calculated, and the spatial coordinates, weight, and corresponding key point index of each pixel are recorded.
[0208] After weighted blending, interpolation smoothing is performed on the boundary pixels to maintain a natural transition between the replacement region and the original key region, generating the image with background replacement.
[0209] Perform standard cropping operations on portrait photos, cropping the image based on key point coordinates and face area positions, and adjusting the image size and proportions to the preset standard size;
[0210] The boundary areas of the portrait photo are smoothed by processing the boundary pixel values using a Gaussian filtering method.
[0211] In this embodiment, the step of reviewing the corrected portrait photograph includes:
[0212] The key point coordinates, head posture, facial occlusion status, and image quality parameters, including brightness, contrast, noise, shadows, and exposure level, are detected in the corrected portrait photos. The detection results are then compared with preset standard thresholds.
[0213] Based on the comparison results, verification markers are generated, and the coordinates of key points or regions that do not meet the standard threshold and their corresponding image quality parameters are recorded to establish a verification dataset.
[0214] Based on the review markers, the optimal correction strategy is adjusted, and the parameters for brightness, contrast, background replacement, standard cropping, and edge smoothing are reconfigured. The sequence of correction actions is also adjusted as necessary. Specifically, the optimal correction strategy is adjusted based on the review markers as follows:
[0215] Read the key point coordinates, region coordinates, anomaly type, anomaly degree and corresponding image quality parameters in the review dataset that do not meet the preset standard threshold, and classify the review marks according to brightness anomaly, contrast anomaly, background anomaly, cropping anomaly and boundary anomaly.
[0216] Based on the spatial location of each verification mark, the weights of the key regions in the fusion features of the abnormal regions and the key regions are associated. The abnormal regions with a key region weight greater than 0.3 are given priority adjustment, and the abnormal regions with a key region weight less than 0.1 are given secondary adjustment.
[0217] When the brightness of the verification mark is abnormal, the brightness adjustment parameters are dynamically fine-tuned according to the brightness deviation value of the abnormal area, the range of the area, and the weight of the corresponding key area. The adjustment includes the brightness increment, the boundary of the area of effect, and the local adjustment range.
[0218] When the verification mark corresponds to an abnormal contrast, the contrast adjustment parameters are dynamically fine-tuned based on the grayscale distribution of the abnormal area, the degree of pixel difference, and the weight of the corresponding key area. The adjustment includes the mapping range, grayscale stretching range, and local contrast increase or decrease.
[0219] When the background is marked as abnormal, the background replacement parameters are dynamically fine-tuned based on the boundary coordinates between the background area and the portrait area, the degree of difference in background color, and the weight of the corresponding key area. The adjustments include the range of the background replacement area, the matching area of the candidate background image, the boundary blending ratio, and the boundary transition width.
[0220] When the verification mark corresponds to a cropping anomaly, the standard cropping parameters are dynamically fine-tuned based on the key point position offset, face region position and proportion deviation. The adjustments include the cropping box center position, cropping box width, cropping box height and image aspect ratio.
[0221] When the verification mark corresponds to an anomaly at the boundary, the boundary smoothing parameters are dynamically fine-tuned based on the pixel change amplitude of the boundary region, the boundary neighborhood range, and the weight of the corresponding key region. The adjustments include the filtering strength, smoothing radius, and boundary neighborhood processing range.
[0222] During the fine-tuning of various parameters, priority is given to adjusting the parameters corresponding to the key areas with a weight greater than 0.3, such as the eye area, nose tip area, mouth corner area, and chin area, and then the parameters corresponding to the non-key areas with a weight less than 0.1 are adjusted.
[0223] When multiple verification markers act on the same area at the same time, they are sorted according to the degree of abnormality of the verification markers and the weight of the key area. The correction parameters are updated in turn, and the execution order of brightness adjustment, contrast adjustment, background replacement, standard cropping and boundary smoothing is reconfigured to form the updated optimal correction strategy. At the same time, the adjusted parameter values, action order, corresponding area coordinates and verification marker index information are recorded.
[0224] Re-perform brightness adjustment, contrast adjustment, background replacement, standard cropping, and edge smoothing operations on the portrait photo, and update the review data record, including adjustment parameters and corresponding pixel coordinate information;
[0225] Repeat the review and correction operations until all review markers meet the preset standard thresholds, forming the final portrait photo correction result, and record the final correction parameters and key point coordinate information.
[0226] Example 1: To verify the feasibility of this invention in practice, it was applied to a standardized digital identity management system. The system received a batch of 1200 portrait photos with a resolution of 1920×1080 pixels. The photos contained slight polarization, localized shadows, and facial occlusion. The average deviation of facial key points in the horizontal and vertical directions was 2.4 pixels, the average image brightness was 0.46, and the background noise rate was approximately 0.12. The system first normalized the original images, scaling the pixel values to the 0-1 range, and used Gaussian filtering to remove high-frequency noise. The filtering window size was 5×5. After processing, the signal-to-noise ratio of the image improved from the original 15.2dB to 19.1dB. Subsequently, the system scanned the face region using a face detection module, identified bounding boxes, and recorded their width, height, and position coordinates. Key point localization and normalization were performed on the eyes, nose tip, corners of the mouth, and chin. The outlier rate was approximately 4.3%. After repeated detection and correction, the key point extraction accuracy reached 97.8%.
[0227] In the key region enhancement stage, the system generates attention maps based on the coordinates of key points and fuses these attention maps with BiSeNet spatial path features. Multi-scale feature processing uses 3×3, 5×5, and 7×7 convolutional kernels to generate feature maps of different scales, with 32, 64, and 96 channels respectively. During the fusion process, the pixels in the key regions are weighted and summed, and then normalized to form the enhanced features. The average response values are 0.82 and 0.78 in the eyes and nose tip regions, respectively, and 0.31 in the background region. Subsequently, the system maps the enhanced features to knowledge graph nodes, constructing a node-feature mapping matrix and weighting the features. Based on knowledge graph constraints, the fused features undergo outlier detection to finally generate the fused key region features for subsequent multi-objective optimization.
[0228] In the multi-objective optimization and correction stage, the system constructs a set of candidate correction actions, including brightness, contrast, cropping, edge smoothing, and background replacement operations. An initial population of 200 individuals is generated for each image, and a multi-objective function is defined to calculate key region integrity, facial proportion standards, and image quality indicators. An improved NSGA-III algorithm is employed, incorporating a refined Pareto sampling strategy for optimization, with an average generation time of 68 milliseconds per image for the optimal correction strategy. Automatic correction operations are executed according to the optimal strategy. Verification results show that the keypoint deviation decreased from an average of 2.4 pixels to 0.8 pixels, and the overall brightness, contrast, and edge smoothing indicators of the image all meet the standards, achieving a 97.5% compliance rate after correction. Compared with traditional threshold rule methods, the accuracy of key region feature extraction is improved by 14%, and the overall image quality score is improved by 12%, verifying the technical advantages of this invention in achieving high precision, multi-objective optimization, and intelligent correction under complex acquisition conditions.
[0229] Table 1. Performance Comparison of the Invention Method and Traditional Methods in Digital Photo Quality Detection and Correction
[0230] Serial Number Test metrics Traditional methods Method of the present invention Sample size Increase 1 Key point deviation (pixels) 2.4 0.8 4000 training images, 1000 testing images -1.6 2 Mean response of key areas in both eyes 0.48 0.82 4000 training images, 1000 testing images +0.34 3 Mean response of key areas of the nasal tip 0.45 0.78 4000 training images, 1000 testing images +0.33 4 Average response of the background area 0.21 0.31 4000 training images, 1000 testing images +0.10 5 Average time for feature extraction (milliseconds / image) 42 28 4000 training images, 1000 testing images -14 6 Optimal correction strategy generation time (milliseconds / sheet) 110 65 4000 training images, 1000 testing images -45 7 Corrected photo verification compliance rate (%) 85.3 97.5 4000 training images, 1000 testing images +12.2 8 Weak feature recognition rate (≤2 pixel key points, %) 52.3 76.8 4000 training images, 1000 testing images +24.5
[0231] As shown in Table 1, the method of this invention significantly outperforms traditional methods in key region feature extraction. The keypoint deviation decreased from an average of 2.4 pixels in traditional methods to 0.8 pixels. The average key region enhancement responses for the eyes and nose tip increased from 0.48 and 0.45 to 0.82 and 0.78, respectively, while the average background region response increased from 0.21 to 0.31. This indicates that the present invention has higher accuracy in enhancing features related to local details and global structure, effectively extracting and enhancing key region information in portraits.
[0232] In terms of processing efficiency, the method of this invention exhibits significant advantages. The average feature extraction time is reduced from 42 milliseconds in the traditional method to 28 milliseconds, and the optimal correction strategy generation time is reduced from 110 milliseconds to 65 milliseconds, demonstrating improvements in computational performance and processing speed. These data indicate that the method of this invention not only improves the accuracy of key region feature extraction but also ensures high processing efficiency, making it suitable for application in batch photo acquisition and processing scenarios.
[0233] In terms of intelligent correction and verification metrics, this invention also demonstrates excellent performance. The verification compliance rate of the corrected photos increased from 85.3% to 97.5%, and the weak feature recognition rate increased from 52.3% to 76.8%, showing the effectiveness of this invention in multi-objective optimization and intelligent correction strategy generation.
[0234] In summary, this invention outperforms traditional methods in terms of key area feature extraction accuracy, image quality control, multi-target optimization, and weak feature recognition, providing reliable, efficient, and intelligent technical support for digital photo acquisition and quality control.
[0235] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for digital photo quality detection and correction based on knowledge graphs, characterized in that, include: The image module acquires a portrait photo to be detected, and the portrait photo is preprocessed, including image size normalization, color space conversion and noise filtering. The face detection module is used to locate the face region and obtain the coordinates of key points including the eyes, nose tip, corners of mouth and chin; A key region attention map is generated based on the key point coordinates. The key region attention map is then fused with the spatial path features of the BiSeNet network to form key region enhancement features, which are then normalized, multi-scale fusion, and channel correction processed. In the feature fusion module of the BiSeNet network, knowledge graph constraints are combined to map the key region enhancement features and the feature nodes, quality defect nodes, defect cause nodes and correction action nodes of the portrait photo to the fused features, and the fused features are weighted according to the region weights generated by the knowledge graph. By using the improved NSGA-III algorithm, based on fusion features and knowledge graph constraints, a set of correction candidate actions is generated. The correction order and parameters of each candidate action combination are optimized in multiple objectives to obtain the optimal correction strategy. Based on the optimal correction strategy, correction operations are performed on the portrait photos, including brightness adjustment, contrast adjustment, background replacement, standard cropping, and edge smoothing. The corrected portrait photos are reviewed to check whether the key point positions, head posture, occlusion, and image quality parameters meet the standard requirements. If they do not meet the standards, the correction strategy is adjusted and the correction operation is repeated until the standards are met.
2. The method for digital photo quality detection and correction based on knowledge graphs according to claim 1, characterized in that, The preprocessing of the portrait photos includes: The high-definition camera of the photo module captures images of the detected object to obtain portrait photos. During the shooting process, the shooting time, lighting conditions and camera parameters are recorded to form an initial image dataset. The portrait photo is subjected to image size normalization processing, the width and height of the image are adjusted to preset pixel values respectively, the aspect ratio is kept unchanged, abnormal sizes are processed, including cropping and padding, and the adjustment parameters are recorded; The normalized portrait photo is converted to a color space, converting the RGB image to a standardized HSV color space. The brightness, chroma, and saturation of each channel are standardized. Gaussian filtering is applied to suppress noise in the pixels, and preliminary smoothing is performed on the edge areas.
3. The method for digital photo quality detection and correction based on knowledge graphs according to claim 1, characterized in that, The acquisition of key point coordinates, including those of the eyes, nose tip, corners of the mouth, and chin, includes: The face detection module scans portrait photos, identifies the bounding box of the face region, including the coordinates of the upper left and lower right corners, records the width, height and position coordinates of the face region in the image, and marks the pixel range information of the bounding box. Within the face area, the coordinates of key points such as the eyes, nose tip, mouth corner and chin are located sequentially using a key point detection algorithm to form a set of key point coordinates. The coordinates of each key point include horizontal and vertical pixel values. Key points that may be occluded, have abnormal lighting or are offset are repeatedly detected. The set of key point coordinates is standardized by dividing the horizontal and vertical pixel values by the width and height of the face region, respectively, to obtain normalized key point coordinates. Outliers are detected and corrected, and then organized and stored according to key point type.
4. The method for digital photo quality detection and correction based on knowledge graphs according to claim 1, characterized in that, The formation of key region enhancement features includes: A key region attention map is generated based on the set of key point coordinates. The key point coordinates are mapped to the corresponding pixel regions on the image. A neighborhood region around each key point is defined, and a weight value is assigned to each neighborhood region. The weight value is calculated from the importance coefficient of the key point and a preset weight coefficient. At the same time, the boundary neighborhood is interpolated and smoothed to form preliminary key region enhancement features. The initial key region enhancement features are fused with the spatial path features of the BiSeNet network. The fusion method includes multiplying the pixel values of the attention map point by point according to the corresponding positions of the channel and the spatial path feature map, summing the weighted features of all key regions, and normalizing the pixels whose values may be out of range after summation. The fused features are normalized in the channel dimension, and the numerical range of each channel is standardized to between 0 and 1. The batch normalization algorithm is then applied to smooth the feature map. The normalized features are mapped to context path features, and then fused through channel weighting, convolution operations, and a feature fusion module to correct feature biases generated during the fusion process. Multi-scale processing is performed in the spatial dimension, and the multi-scale features are weighted and summed with the context path features to generate key region enhancement features, which include local details and global structural information.
5. The method for digital photo quality detection and correction based on knowledge graphs according to claim 1, characterized in that, The weighting of the fused features based on the region weights generated from the knowledge graph includes: Using key region enhancement features as input, the system receives portrait photo feature nodes, quality defect nodes, defect cause nodes, and correction action nodes defined in the knowledge graph, and records the spatial location and attribute information of each node. A BiSeNet network is constructed, which consists of a multi-scale feature fusion module, a key point guided attention module, and a graph constraint fusion module. The consistency and integrity of key region features and spatial path features are maintained in each module. In the multi-scale feature fusion module, the key region enhancement features and spatial path features are convolved to generate a multi-scale feature map. The convolution path is adaptively selected according to the key point weights. Cross-regional attention interaction fusion is performed on the convolved multi-scale feature map, the residual information is preserved and dynamically weighted, and the fused multi-scale features are subjected to local-global joint normalization processing. At the same time, the neighborhood relationship constraint of key points is established, and the neighborhood pixels are weighted and fused to form the final multi-scale feature sequence. In the key point guided attention module, an attention weight map is generated based on the key point coordinates. The key region pixels of the multi-scale feature sequence are weighted, the boundary pixels are interpolated and smoothed, and the neighborhood features are normalized to form a key point guided weighted feature sequence, while retaining the key point position index. In the knowledge graph constraint fusion module, knowledge graph node information is mapped to a weighted feature sequence guided by key points, a node-feature mapping matrix is constructed, the features are weighted according to the relationship between nodes and preset coefficients, and the node constraint information is fused through channel weighting, convolution and batch normalization. The fused features are then subjected to outlier detection and correction to generate key region fused features.
6. The method for digital photograph quality detection and correction based on knowledge graphs according to claim 1, characterized in that, The optimal correction strategy is obtained by: Using key region fusion features as input, a candidate correction action set is constructed. Each action includes brightness, contrast, cropping, boundary smoothing and background replacement parameters. The candidate actions are encoded to form an initial population, and the spatial distribution and weight information of the key region features corresponding to each individual are recorded. A multi-objective optimization function is defined, and the optimization indicators include key region integrity, facial proportion standard, occlusion region processing, image quality parameters, and correction action coupling degree. The target value is calculated for each individual in the initial population, and the target indicators and weights are recorded. Based on the weights of the key region fusion features and the distribution of each candidate correction action individual in the multi-objective index space, an adaptive reference point set is generated, and the coordinates and corresponding weights of the reference points are recorded. The initial population is subjected to non-dominated sorting, crowding distance is calculated, and a refined Pareto sampling strategy is combined to preferentially select individuals that match reference points with key region weights exceeding a preset threshold from the Pareto optimal solution set, forming a balanced sampling subset. Crossover and mutation operations are performed on the population to generate a new generation of individuals. Crossover adopts a feature-weighted exchange strategy, and mutation combines key region feature perturbation and node weight fine-tuning. The new generation of individuals is merged with the previous generation of elite individuals, non-dominated sorting and crowding distance calculation are performed, and the reference point position is dynamically adjusted according to the refined Pareto sampling strategy. The crossover, mutation, sorting and sampling operations are repeated until the preset number of iterations or convergence conditions are reached. For the final Pareto frontier individual set, a comprehensive score is calculated based on the key region fusion feature weights and multi-objective indicators to generate the optimal combination of correction actions and parameter set, while recording key region, node mapping and Pareto reference point information. The optimal combination of correction actions and parameters are used as output to form the optimal correction strategy generated by the improved NSGA-III algorithm, while the final correction parameters and key point coordinate information are recorded.
7. The method for digital photograph quality detection and correction based on knowledge graphs according to claim 1, characterized in that, The process of performing correction operations on portrait photos includes: According to the optimal correction strategy, the brightness of the portrait photo is adjusted by adding or subtracting the brightness channel values of each pixel in the original image according to the preset adjustment parameters in the optimal correction strategy, and the adjustment parameters and corresponding pixel coordinate information are recorded at the same time. Contrast adjustment is performed on portrait photos, and pixel values are mapped according to the linear mapping function in the optimal correction strategy to stretch the image pixel distribution to a preset range. Outlier detection and correction are performed on the mapping results. The background replacement operation is performed on portrait photos. The original background area and the candidate background image are overlaid at the pixel level, and then mixed and merged according to the weight map generated by the boundary area. Perform standard cropping operations on portrait photos, cropping the image based on key point coordinates and face area positions, and adjusting the image size and proportions to the preset standard size; The boundary areas of the portrait photo are smoothed by processing the boundary pixel values using a Gaussian filtering method.
8. The method for digital photograph quality detection and correction based on knowledge graphs according to claim 1, characterized in that, The review of the corrected portrait photos includes: The key point coordinates, head posture, facial occlusion status, and image quality parameters, including brightness, contrast, noise, shadows, and exposure level, are detected in the corrected portrait photos. The detection results are then compared with preset standard thresholds. Based on the comparison results, verification markers are generated, and the coordinates of key points or regions that do not meet the standard threshold and their corresponding image quality parameters are recorded to establish a verification dataset. The optimal correction strategy is adjusted based on the review marks, and the parameters of brightness, contrast, background replacement, standard cropping and edge smoothing are reconfigured, and the order of correction actions is adjusted as necessary. Re-perform brightness adjustment, contrast adjustment, background replacement, standard cropping, and edge smoothing operations on the portrait photo, and update the review data record, including adjustment parameters and corresponding pixel coordinate information; Repeat the review and correction operations until all review markers meet the preset standard thresholds, forming the final portrait photo correction result, and record the final correction parameters and key point coordinate information.