Chinese chestnut DR image data enhancement method and system based on bit plane reconstruction

By employing bit-plane reconstruction and Dirichlet distribution data augmentation methods, the problems of difficult data acquisition and weak model generalization in chestnut DR image detection are solved, achieving efficient expansion of the training dataset and improving the accuracy and stability of detection.

CN121767249APending Publication Date: 2026-03-31HENAN AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In chestnut DR image detection, data acquisition is costly, annotation is time-consuming and labor-intensive, and the uneven distribution of samples leads to weak generalization ability of deep learning models, making them prone to overfitting and affecting detection accuracy and security.

Method used

A bit-plane reconstruction data augmentation method is adopted. Chestnut DR images are acquired through an X-ray imaging system, and noise suppression, image enhancement and bit-plane decomposition are performed. A bit-plane weight vector is constructed, and multiple enhanced images are generated by random sampling using the Dirichlet distribution to expand the training dataset.

Benefits of technology

It improves the model's generalization ability and robustness, enhances image quality and detail preservation, avoids overfitting, and improves detection accuracy and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121767249A_ABST
    Figure CN121767249A_ABST
Patent Text Reader

Abstract

The invention relates to a Chinese chestnut DR image data enhancement method and system based on bit plane reconstruction, and the method comprises the following steps: S1, image collection: carrying out the imaging collection of a Chinese chestnut sample through an X-ray digital projective imaging system, and obtaining a Chinese chestnut image through controlling the voltage, current and exposure conditions of an X-ray tube; enabling the X-ray to penetrate through the Chinese chestnut sample and form a two-dimensional gray transmission image at a detection end, thereby obtaining Chinese chestnut DR gray image data capable of reflecting the density distribution characteristics of the internal structure of the Chinese chestnut; according to the Chinese chestnut DR image data enhancement method based on bit-plane reconstruction, multiple enhanced images with different weight combinations are generated through multiple sampling of Dirichlet distribution, diversity is introduced for an original data set through weight change of the images, the over-fitting phenomenon is avoided, and especially in the training process, the image is more accurate and more accurate. The model can see richer image variants, and the generalization ability of the model in practical application is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and in particular to a method and system for enhancing chestnut DR image data through bit-plane reconstruction. Background Technology

[0002] X-ray digital radiography (DR) imaging technology, as an advanced non-destructive testing method, has shown great potential in the field of agricultural product quality assessment. Compared with traditional appearance inspection methods, DR imaging can penetrate the outer shell and epidermis of agricultural products to directly obtain internal structural information and achieve accurate identification of internal defects. This technological advantage makes it irreplaceable in the quality inspection of nut-based agricultural products, such as camellia seeds, chestnuts, walnuts, and almonds. In recent years, with the continuous improvement of consumers' requirements for food safety and quality, as well as the demand for large-scale and standardized development of the agricultural product industry, intelligent inspection technology based on DR imaging has received widespread attention.

[0003] In practice, some problems still exist:

[0004] However, in intelligent detection based on DR imaging, deep learning models typically require a large amount of labeled data to achieve ideal performance. Yet, in the field of chestnut DR image detection, obtaining sufficient training data presents a significant challenge:

[0005] Data acquisition cost: Although DR imaging is less expensive than CT and other technologies, industrial-grade X-ray DR detection systems still require an investment of hundreds of thousands of yuan. Each imaging requires strict adjustment of multiple parameters such as X-ray tube voltage, current, and exposure time. Radiation protection also needs to be considered. Unlike natural images, which can be acquired in batches by ordinary cameras, chestnut DR images require professional equipment, trained operators, and strict quality control, resulting in relatively low data acquisition efficiency.

[0006] The time-consuming annotation process: Annotating chestnut DR images requires professionals to combine multi-dimensional information such as density differences, morphological features, and spatial distribution to determine the type of defects. Annotators need to identify features such as the irregular shape of wormholes, the boundaries of holes, and the slight density changes caused by dryness. Annotating a single complex image may take 3-5 minutes, and building a usable dataset usually requires a large number of annotated samples.

[0007] Imbalanced sample distribution and insufficient diversity: In actual production, healthy chestnuts account for the vast majority, while the proportion of defective samples such as double-core, moldy, and insect-damaged chestnuts is low and unevenly distributed. This natural class imbalance causes the model to favor the majority class, resulting in low recognition rates for minority classes such as double-core and moldy chestnuts. In addition, due to relatively fixed collection conditions, the data is difficult to cover chestnut samples from different origins, varieties, maturity levels, and storage times, leading to weak generalization ability of the model for new scenarios and new batches, and decreased performance in practical applications.

[0008] Furthermore, with limited training data, deep neural networks are prone to overfitting the specific features of the training samples rather than learning the essential patterns of chestnut defects. This manifests as the model performing well on the training set, but its accuracy drops significantly on the test set or in real-world applications. For chestnut detection, which is related to food safety and economic benefits, overfitting may lead to misjudging insect-infested or moldy chestnuts as qualified products, thus posing a food safety hazard, or misjudging healthy chestnuts as defective products, resulting in economic losses and resource waste. Summary of the Invention

[0009] (a) Technical problems to be solved

[0010] To address the aforementioned problems in the prior art, this invention provides a method and system for enhancing chestnut DR image data through bit-plane reconstruction, thereby resolving the issues raised in the background section.

[0011] (II) Technical Solution

[0012] To achieve the above objectives, the main technical solution adopted by the present invention is as follows:

[0013] A method and system for enhancing chestnut DR image data through bit-plane reconstruction includes the following steps:

[0014] S1: Image acquisition step. The chestnut sample is imaged using an X-ray digital radiographic imaging system. By controlling the voltage, current and exposure conditions of the X-ray tube, the X-rays penetrate the chestnut sample and form a two-dimensional grayscale transmission image at the detector end, thereby obtaining chestnut DR grayscale image data that can reflect the internal structural density distribution characteristics of the chestnut.

[0015] S2: Image preprocessing step, the chestnut DR grayscale image obtained in step S1 is subjected to noise suppression and image enhancement processing in sequence. The image preprocessing includes using Gaussian filtering to reduce random noise introduced by the imaging system while maintaining the overall structural information of the image, then using median filtering to reduce the impact of local abnormal noise on subsequent processing, then using background removal algorithm to weaken the interference of non-uniform background on the chestnut main area, and using histogram equalization to enhance the grayscale contrast of the internal structure of the chestnut, and finally sharpening the image to highlight edge details, and adjusting the processed image to a uniform size;

[0016] S3: Bit plane decomposition step, the preprocessed chestnut DR grayscale image is decomposed into bit planes according to the pixel grayscale value, the grayscale information of each pixel is split into multiple binary bit planes, so that different bit planes carry information of different grayscale levels. The high bit plane is used to represent the main structural features inside the chestnut, and the low bit plane is used to represent the fine texture and local density change information.

[0017] S4: Bit plane weight construction step: Based on the importance distribution of bit planes in chestnut DR image information representation, construct the corresponding bit plane weight vector, and normalize the weight vector so that the weight values ​​of each bit plane satisfy the constraint condition that the sum is one, thereby forming a priori weight distribution that reflects the relative importance of bit planes.

[0018] S5: Dirichlet weight sampling step, constructing the concentration parameters of the Dirichlet distribution based on the normalized bit plane weight vector, and randomly sampling through the Dirichlet distribution to generate a new bit plane weight vector, so as to introduce continuously changing weight combinations while maintaining the integrity of bit plane information;

[0019] S6: Image reconstruction and normalization step. Based on the bit plane weights obtained in step S5, the bit planes obtained in step S3 are reconstructed by weighting to generate a new enhanced chestnut DR image. The generated enhanced image is then normalized in grayscale range so that its grayscale value distribution covers the preset effective dynamic range, thereby obtaining data augmentation samples for model training.

[0020] The X-ray digital radiographic imaging system described in step S1 uses a desktop X-ray scanning device for imaging. During the imaging process, the X-ray tube voltage is set to 50kV and the current is set to 5mA. The X-ray DR grayscale image data of the chestnut is acquired through a 16-bit digital data acquisition system.

[0021] After preprocessing the chestnut DR grayscale image in step S2, the image is uniformly scaled or cropped to a standard size of 224×224 pixels and stored in JPG format to ensure consistency in subsequent bit-plane decomposition and data augmentation processing.

[0022] The bit plane decomposition in step S3 is to process the chestnut DR image with a gray value range of 0 to 255, and decompose the gray image into 8 bit planes, each bit plane corresponding to a different binary weight level in the gray value of the image;

[0023] For the acquired grayscale image I, whose pixel intensity range is [0, 255], it is decomposed into 8 binary bit planes {B0, B1, ..., B7}, where the extraction method of the i-th plane Bi is as follows:

[0024]

[0025] Where (x,y) represents pixel coordinates, higher-order bit planes such as B7 and B6 contain the main structural information of the image, while lower-order bit planes capture finer texture details;

[0026] set up This represents the original weight vector obtained based on bit-plane importance analysis, where the weight values ​​for each bit-plane are: This weight allocation reflects the importance distribution of the bit plane in the image representation. By normalizing the original weights, a weight normalization vector is obtained. .

[0027] In the bit-plane weight vector constructed in step S4, each bit-plane is assigned a non-zero weight, thereby preventing any bit-plane information from being completely discarded during the data augmentation process, and ensuring the continuity of the density information of the chestnut DR image.

[0028] In step S5, the concentration parameter of the Dirichlet distribution is determined by the normalized bit plane weight vector and the concentration parameter. The concentration parameter is used to control the degree of dispersion of the sampling weights relative to the original weight distribution.

[0029] Concentration parameter vector of Dirichlet distribution Normalized prior weights With concentration parameter Jointly decided, expressed as in the following formula:

[0030]

[0031] Where 8 represents the number of bit planes, For concentration parameters, The larger the value, the more concentrated the sampling results are. nearby, The smaller the value, the stronger the randomness of the sampling;

[0032] Based on concentration parameters A new weight vector is generated by sampling from the Dirichlet distribution. :

[0033]

[0034] Concentration parameter The larger the value, the more concentrated the sampling results are. nearby, The smaller the value, the stronger the randomness of the sampling.

[0035] The concentration parameter is set to a value of 2 to achieve a balance between enhancing sample diversity and the stability of the weight distribution.

[0036] In step S6, the grayscale normalization process performed on the enhanced image uses a minimum and maximum scaling method to ensure that the generated enhanced image fully utilizes the entire grayscale dynamic range while maintaining the original structural features.

[0037] For each original chestnut DR image, multiple enhanced images with different weight combinations are generated by independently sampling the Dirichlet distribution multiple times, thereby multiplying the training dataset.

[0038] Given a weight vector sampled from a Dirichlet distribution The enhanced image is obtained from the bit plane set {B0, B1, ..., B7} extracted from the original image I. Synthesized in the following ways:

[0039]

[0040] Mini-maximum scaling ensures that the generated enhanced image fully utilizes the entire grayscale dynamic range [0,255], effectively avoiding the problem of insufficient image contrast caused by uneven weight distribution.

[0041]

[0042] For each original training sample, N augmented variants are generated by independently sampling N times from the Dirichlet distribution, thereby expanding the training set by N+1 times.

[0043] A bit-plane reconstruction chestnut DR image data enhancement system includes:

[0044] The image acquisition module is used to acquire X-ray DR grayscale images of chestnuts;

[0045] The image preprocessing module is used to perform filtering, background removal, contrast enhancement, and size unification processing on the DR grayscale image;

[0046] The bit-plane decomposition module is used to decompose the preprocessed chestnut DR image into multiple bit planes;

[0047] The weight construction and sampling module is used to construct bit-plane weight vectors and generate new bit-plane weights based on the Dirichlet distribution.

[0048] The image reconstruction module is used to reconstruct each bit plane based on the bit plane weights obtained from sampling and output the enhanced chestnut DR image.

[0049] (III) Beneficial Effects

[0050] The beneficial effects of this invention are:

[0051] 1. The bit-plane reconstruction chestnut DR image data augmentation method of the present invention generates multiple augmented images with different weight combinations through multiple samplings of the Dirichlet distribution. These images introduce diversity into the original dataset through weight changes, avoiding overfitting. Especially during training, the model can see richer image variations, improving its generalization ability in practical applications. Traditional data augmentation methods often rely on simple geometric transformations or noise addition, while this method, through bit-plane decomposition and weighted reconstruction technology, can generate new images with different information combinations for each image, thereby expanding the scale and diversity of the training dataset, avoiding the model learning only on limited training samples, and improving the deep learning model's ability to learn complex data patterns.

[0052] 2. Through image preprocessing and bit-plane decomposition, this invention can significantly improve the quality of chestnut DR images. The combination of Gaussian filtering and median filtering effectively removes noise during the imaging process while preserving the structural information of the image. Background removal algorithms and histogram equalization techniques enhance the contrast of the image, making the internal structure of the chestnut clearer. In addition, bit-plane decomposition separates the information of different gray levels of the image, ensuring that the main structural features expressed by the high bit plane are completely preserved, while the low bit plane captures details and texture information. Image sharpening further highlights edge details, which helps to improve the clarity and recognizability of the image, thus ensuring that while enhancing image quality, details are also well preserved.

[0053] 3. The method of this invention introduces continuously varying weight combinations through weighted reconstruction of the bit plane weights and sampling of the Dirichlet distribution, so that each enhanced image contains different levels of image information. In this way, the model can learn features under different weight distributions, enhancing the robustness of model training. The image is normalized by using minimum-maximum scaling to ensure that the enhanced image can make full use of the grayscale dynamic range, thereby avoiding insufficient contrast. By generating multiple enhancement variants, this invention effectively expands the dataset, helping the model to better adapt to different input conditions and enhancing its adaptability to new scenarios in practical applications. Finally, the trained model can maintain stable performance under various data conditions, further improving the practicality and stability of the model. Attached Figure Description

[0054] Figure 1 This is a schematic diagram of the workflow of the present invention;

[0055] Figure 2 This is a schematic diagram of the category browsing function of the present invention;

[0056] Figure 3 This is a schematic diagram showing the comparative analysis of various positional planes in this invention;

[0057] Figure 4 This is a schematic diagram of the image bit plane visualization of the present invention;

[0058] Figure 5 This is a schematic diagram of the image data enhancement module of the present invention. Detailed Implementation

[0059] To better explain and facilitate understanding of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0060] Please refer to Figures 1 to 5 As shown, the present invention provides a method and system for enhancing chestnut DR image data through bit-plane reconstruction, comprising the following steps:

[0061] S1: Image acquisition step. The chestnut sample is imaged using an X-ray digital radiographic imaging system. By controlling the voltage, current and exposure conditions of the X-ray tube, the X-rays penetrate the chestnut sample and form a two-dimensional grayscale transmission image at the detector end, thereby obtaining chestnut DR grayscale image data that can reflect the internal structural density distribution characteristics of the chestnut.

[0062] S2: Image preprocessing step. The chestnut DR grayscale image obtained in step S1 is subjected to noise suppression and image enhancement processing in sequence. Image preprocessing includes using Gaussian filtering to reduce random noise introduced by the imaging system while maintaining the overall structural information of the image. Then, median filtering is used to reduce the impact of local abnormal noise on subsequent processing. Subsequently, background removal algorithm is used to weaken the interference of non-uniform background on the chestnut main area. Histogram equalization is used to enhance the grayscale contrast of the internal structure of the chestnut. Finally, the image is sharpened to highlight edge details and the processed image is adjusted to a uniform size.

[0063] S3: Bit plane decomposition step, the preprocessed chestnut DR grayscale image is decomposed into bit planes according to the pixel grayscale value, the grayscale information of each pixel is split into multiple binary bit planes, so that different bit planes carry information of different grayscale levels. The high bit plane is used to represent the main structural features inside the chestnut, and the low bit plane is used to represent the fine texture and local density change information.

[0064] S4: Bit plane weight construction step. Based on the importance distribution of bit planes in chestnut DR image information representation, construct the corresponding bit plane weight vector and normalize the weight vector so that the weight values ​​of each bit plane satisfy the constraint that the sum is one, thereby forming a priori weight distribution that reflects the relative importance of bit planes.

[0065] S5: Dirichlet weight sampling step, constructing the concentration parameters of the Dirichlet distribution based on the normalized bit plane weight vector, and randomly sampling through the Dirichlet distribution to generate a new bit plane weight vector, so as to introduce continuously changing weight combinations while maintaining the integrity of bit plane information;

[0066] S6: Image reconstruction and normalization step. Based on the bit-plane weights obtained in step S5, the bit-planes obtained in step S3 are reconstructed using weighted averages to generate new enhanced chestnut DR images. The generated enhanced images are then normalized to ensure their gray-scale distribution covers a preset effective dynamic range, thus obtaining data augmentation samples for model training. In actual implementation, during the image acquisition step, chestnut samples are imaged using an X-ray digital radiography imaging system. The system controls the X-ray tube voltage, current, and exposure conditions to ensure that X-rays can uniformly penetrate the chestnut sample and form a two-dimensional gray-scale transmission image at the detector end. These images accurately reflect the internal structural density distribution characteristics of the chestnut. Acquiring X-ray images is not only the foundation for data augmentation but also provides detailed internal structural information for subsequent image processing and analysis. With reasonable exposure condition control, the imaging quality can reflect the density differences of the chestnut to the greatest extent, ensuring the accuracy and operability of subsequent data processing.

[0067] Optionally, in step S1, the X-ray digital radiography imaging system uses a desktop X-ray scanning device for imaging. During the imaging process, the X-ray tube voltage is set to 50kV and the current is set to 5mA. X-ray DR grayscale image data of the chestnut is acquired through a 16-bit digital data acquisition system. In actual implementation, the image preprocessing step first performs noise suppression and image enhancement processing on the acquired chestnut DR grayscale image. Gaussian filtering is used to reduce random noise introduced during imaging while maintaining the overall structural information of the image. Median filtering effectively reduces the impact of local noise on subsequent image processing. Furthermore, a background removal algorithm is used to remove non-uniform backgrounds from the image. Finally, histogram equalization is used to improve grayscale contrast, ensuring that the details of the chestnut's internal structure are more prominent. Image sharpening helps enhance edge details. Finally, all processed images are adjusted to a uniform size to ensure consistency in subsequent processing.

[0068] Optionally, after preprocessing the chestnut DR grayscale image in step S2, the image is uniformly scaled or cropped to a standard size of 224×224 pixels and stored in JPG format to ensure consistency in subsequent bit-plane decomposition and data enhancement processing. In actual implementation, the bit-plane decomposition step is one of the core steps of this method. In this process, the preprocessed chestnut DR grayscale image is decomposed according to pixel grayscale values, and the grayscale information of each pixel is split into multiple binary bit-planes. Among them, the high bit-planes such as B7 and B6 carry the main structural information of the image, while the low bit-planes such as B0 and B1 show subtle texture changes and local density changes. The whole process ensures that information at different grayscale levels is effectively separated, and each bit-plane carries a different information level. Through bit-plane decomposition, the complex information in the image can be decomposed and processed separately, enhancing the effect of subsequent image reconstruction and enhancement.

[0069] Optionally, the bit plane decomposition in step S3 is to process the chestnut DR image with a gray value range of 0 to 255, and decompose the gray image into 8 bit planes, each bit plane corresponding to a different binary weight level in the gray value of the image.

[0070] For the acquired grayscale image I, whose pixel intensity range is [0, 255], it is decomposed into 8 binary bit planes {B0, B1, ..., B7}, where the extraction method of the i-th plane Bi is as follows:

[0071]

[0072] Where (x,y) represents pixel coordinates, higher-order bit planes such as B7 and B6 contain the main structural information of the image, while lower-order bit planes capture finer texture details;

[0073] set up This represents the original weight vector obtained based on bit-plane importance analysis, where the weight values ​​for each bit-plane are: This weight allocation reflects the importance distribution of the bit plane in the image representation. By normalizing the original weights, a weight normalization vector is obtained. In the actual implementation process, during the bit-plane weight construction step, a corresponding weight vector is constructed by analyzing the importance of each bit-plane. The weight values ​​are allocated based on the importance of the bit-plane to the image information representation. The weight allocation reflects the contribution of each bit-plane to the image representation. After normalization, it is ensured that the sum of the weights of all bit-planes is 1. This ensures that each bit-plane can play its due role in the enhancement process, avoids the complete discarding of information from any bit-plane during data enhancement, maintains the continuity of image density information, and further enhances the detail level of image information.

[0074] Optionally, in the bit-plane weight vector constructed in step S4, each bit-plane is assigned a non-zero weight, thereby preventing any bit-plane information from being completely discarded during data augmentation and ensuring the continuity of density information in the chestnut DR image. In actual implementation, in the Dirichlet weight sampling step, a Dirichlet distribution concentration parameter is constructed based on the normalized bit-plane weight vector. The magnitude of the concentration parameter directly affects the dispersion of the sampling weights. A larger concentration parameter makes the sampling results more concentrated, while a smaller concentration parameter increases the randomness of sampling. Dirichlet distribution sampling allows the newly generated bit-plane weight vector to introduce different weight combinations while maintaining the integrity of the original information. In this way, the image reconstruction can present more diverse features, enhancing the diversity of the generated images and the richness of the training samples, ensuring that the image augmentation effect is more flexible.

[0075] Optionally, in step S5, the concentration parameter of the Dirichlet distribution is determined by the normalized bit plane weight vector and the concentration parameter. The concentration parameter is used to control the degree of dispersion of the sampling weights relative to the original weight distribution.

[0076] Concentration parameter vector of Dirichlet distribution Normalized prior weights With concentration parameter Jointly decided, expressed as in the following formula:

[0077]

[0078] Where 8 represents the number of bit planes, For concentration parameters, The larger the value, the more concentrated the sampling results are. nearby, The smaller the value, the stronger the randomness of the sampling;

[0079] Based on concentration parameters A new weight vector is generated by sampling from the Dirichlet distribution. :

[0080]

[0081] Concentration parameter The larger the value, the more concentrated the sampling results are. nearby, The smaller the value, the stronger the sampling randomness. In actual implementation, the image reconstruction and normalization steps reconstruct each bit plane based on the bit plane weights sampled from the Dirichlet distribution, generating a new enhanced image. During the weighted reconstruction process, it is ensured that the important information of each bit plane is reasonably preserved. The generated enhanced image is then normalized to grayscale using a minimum-maximum scaling method, ensuring that the grayscale value distribution of the image can cover the preset effective dynamic range. This processing avoids the problem of insufficient contrast during image enhancement, ensuring that the generated image maintains visual consistency with the original image, and on this basis, improves the image's expressiveness, making it more suitable for model training and application.

[0082] Optionally, the concentration parameter is set to 2 to achieve a balance between enhancing sample diversity and weight distribution stability. In practical implementation, the concentration parameter plays a crucial role in enhancing sample diversity and weight distribution stability during Dirichlet distribution sampling. The value of the concentration parameter determines the degree of concentration of the sampling results. A concentration parameter value of 2 ensures that the generated enhanced image maintains moderate stability in weight distribution while guaranteeing the diversity of enhanced samples. This setting effectively balances sample diversity and enhanced image quality, allowing the dataset to expand while maintaining the practical application value of the enhanced samples, avoiding overly random or overly concentrated enhancement effects.

[0083] Optionally, the grayscale normalization process performed on the enhanced image in step S6 employs a minimum and maximum scaling method, ensuring that the generated enhanced image fully utilizes the entire grayscale dynamic range while maintaining its original structural features. In practical implementation, after image reconstruction, the generated enhanced image undergoes grayscale normalization and minimum and maximum scaling. This method ensures that the enhanced image fully utilizes the entire grayscale dynamic range, maintains the original structural features of the image, and enhances image contrast, making details more apparent. It avoids image quality degradation caused by over-compression or unbalanced grayscale value distribution. The minimum-maximum scaling method maintains consistency across all enhanced images, providing high-quality visual input samples for subsequent training and further enhancing the model's learning ability.

[0084] Optionally, for each original chestnut DR image, multiple enhanced images with different weight combinations are generated by independently sampling the Dirichlet distribution multiple times, thereby multiplying the training dataset.

[0085] Given a weight vector sampled from a Dirichlet distribution The enhanced image is obtained from the bit plane set {B0, B1, ..., B7} extracted from the original image I. Synthesized in the following ways:

[0086]

[0087] Mini-maximum scaling ensures that the generated enhanced image fully utilizes the entire grayscale dynamic range [0,255], effectively avoiding the problem of insufficient image contrast caused by uneven weight distribution.

[0088]

[0089] For each original training sample, N enhanced variants are generated by independently sampling N times from the Dirichlet distribution, thus expanding the training set by N+1 times. In practical implementation, this invention generates multiple enhanced images with different weight combinations for each original chestnut DR image by independently sampling the Dirichlet distribution multiple times, thereby expanding the training dataset. The enhanced images use minimum-maximum scaling to ensure full utilization of the entire grayscale dynamic range, thus avoiding contrast problems caused by uneven weight distribution. Each original training sample generates multiple enhanced variants through N independent sampling, ultimately achieving an N+1-fold expansion of the training set. This process greatly increases the diversity of the dataset, providing the model with more diverse training samples, thereby enhancing the model's robustness and generalization ability.

[0090] Optionally, a bit-plane reconstruction chestnut DR image data enhancement system includes:

[0091] The image acquisition module is used to acquire X-ray DR grayscale images of chestnuts;

[0092] The image preprocessing module is used to filter, remove backgrounds, enhance contrast, and unify the size of DR grayscale images.

[0093] The bit-plane decomposition module is used to decompose the preprocessed chestnut DR image into multiple bit planes;

[0094] The weight construction and sampling module is used to construct bit-plane weight vectors and generate new bit-plane weights based on the Dirichlet distribution.

[0095] The image reconstruction module is used to reconstruct each bit plane based on the sampled bit plane weights and output the enhanced chestnut DR image. In actual implementation, the data augmentation system of this invention includes an image acquisition module, an image preprocessing module, a bit plane decomposition module, a weight construction and sampling module, and an image reconstruction module. The system works collaboratively, and each step from image acquisition to data augmentation is strictly performed according to the design steps. The image acquisition module is responsible for acquiring the X-ray DR grayscale image of the chestnut. The preprocessing module performs filtering, background removal, and contrast enhancement on the image. The bit plane decomposition module decomposes the image. The weight construction and sampling module is responsible for generating new bit plane weights. The image reconstruction module reconstructs the image based on the sampled weights and generates the final enhanced image. The entire process is modularly designed to ensure the diversity and consistency of the enhanced image dataset.

[0096] To verify the effectiveness and superiority of the technical solution of this invention, this embodiment designed and conducted corresponding experiments. The experimental environment was configured as follows: a high-performance computing platform was provided to ensure the efficiency of large-scale data processing and deep learning model training. The experiment used a dataset of actually collected chestnut X-ray DR images for training and testing. The specific hardware configuration, experimental conditions, and data processing flow are as follows:

[0097] The experiment used a chestnut X-ray DR image dataset, with samples collected from commercial orchards in two different production areas: Qianxi, Hebei Province, and Luotian, Hubei Province. To maintain sample freshness and minimize natural degradation, all samples were immediately refrigerated at 4°C and 60% relative humidity after collection. Samples without surface cracks, damage, or abnormal color were manually selected for X-ray DR scanning, and a destructive detection method was used to obtain reference results for internal features. The dataset contains four categories of chestnut samples: 55 healthy chestnuts, 77 double-kernel chestnuts, 44 moldy chestnuts, and 61 insect-infested chestnuts, totaling 237 samples. Each category of samples was randomly divided into training, validation, and prediction sets in an approximately 60:20:20 ratio.

[0098] In the experiment, the batch size was 16, the learning rate was 0.001, the optimizer was Adam, the loss function was cross-entropy, the maximum number of training epochs was 100, and an early stopping mechanism was introduced.

[0099] (patience=15, min_improvement=0.001), concentration parameter c=2. All images are scaled to 224×224 pixels.

[0100] Table 1 shows the impact of different augmentation factors on the classification performance of ResNet18. For the baseline ResNet18 model without ImageNet pre-training, the accuracy (ACC) is 0.4375, the AUC is 0.6184, the sensitivity (SEN) is 0.4157, and the specificity (SPE) is 0.8048. After applying Dirichlet bit-plane augmentation, the 5x augmentation configuration achieved the best performance improvement, with an ACC of 0.5625 (a 28.57% improvement over the baseline), an AUC of 0.7251 (a 17.26% improvement), a SEN of 0.5515 (a 32.67% improvement), and a SPE of 0.8445 (a 4.93% improvement). The 3x augmentation also showed significant improvement, with ACC and AUC improving by 19.02% and 23.95%, respectively, and a SEN improvement of 30.05%. However, as the enhancement factor further increases to 7x and 9x, the performance gain gradually decreases. The ACC of 9x enhancement is only 0.4583, close to the baseline level, indicating that excessive enhancement may introduce redundant information, leading to a decrease in the model's generalization ability.

[0101] Introducing ImageNet pre-trained weights significantly improved baseline performance. The pre-trained ResNet18 achieved an ACC of 0.5417 and an AUC of 0.8070, representing improvements of 23.81% and 30.50% respectively compared to the untrained version. Applying Dirichlet augmentations on top of pre-training, a 5x augmentation again yielded optimal results: ACC of 0.6250, AUC of 0.8538, SEN of 0.6241, and SPE of 0.8709, representing improvements of 15.38%, 5.80%, 15.49%, and 3.83% respectively compared to the pre-trained baseline. A 7x augmentation performed exceptionally well in terms of sensitivity, achieving a SEN of 0.6348, a 17.47% improvement, but its overall ACC was slightly lower than the 5x augmentation. Notably, a 9x augmentation resulted in a performance decline, with the ACC dropping to 0.5000 and the AUC to 0.7775, all metrics falling below the pre-trained baseline, confirming that excessive augmentation also has negative effects in scenarios with pre-training.

[0102] Table 1. Performance Comparison of Data Augmentation and Baseline Model

[0103] method ACC AUC SEN SPE ACC↑ AUC↑ SEN↑ SPE↑ resnet18 0.4375 0.6184 0.4157 0.8048 - - - - ResNet 18+ 3x Enhancement 0.5208 0.7666 0.5406 0.8432 +19.02% +23.95% +30.05% +4.77% ResNet 18+5x Enhancement 0.5625 0.7251 0.5515 0.8445 +28.57% +17.26% +32.67% +4.93% ResNet 18+7x Enhancement 0.4792 0.7511 0.5025 0.8296 +9.53% +21.46% +20.88% +3.08% ResNet 18+9 times enhanced 0.4583 0.6888 0.4468 0.8165 +4.75% +11.38% +7.48% +1.45% resnet18+pretrain 0.5417 0.8070 0.5404 0.8388 - - - - resnet18+pretrain+3x enhancement 0.6042 0.8279 0.6155 0.8652 +11.54% +2.59% +13.90% +3.15% resnet18+pretrain+5x enhancement 0.6250 0.8538 0.6241 0.8709 +15.38% +5.80% +15.49% +3.83% ResNet18+ pretraining+ 7x enhancement 0.6042 0.8439 0.6348 0.8690 +11.54% +4.57% +17.47% +3.60% ResNet18+ pretraining+ 9x enhancement 0.5000 0.7775 0.4833 0.8226 -7.70% -3.66% -10.57% -1.93%

[0104] Note: The ResNet18+ Enhanced series offers computational improvement over ResNet18; the ResNet18+Pretrain+Enhanced series offers computational improvement over ResNet18+Pretrain. The bolded lines represent the best-performing models.

[0105] Comprehensive comparisons show that pre-trained ResNet18 combined with 5x Dirichlet bit-plane augmentation is the optimal configuration, achieving the best balance in accuracy, AUC, and sensitivity. Compared to the baseline without pre-training or augmentation, this configuration improves ACC by 42.86% (0.4375→0.6250) and AUC by 38.08% (0.6184→0.8538), fully validating the synergistic advantages of pre-trained transfer learning and data augmentation. The choice of augmentation factor exhibits a clear inverted U-shaped curve characteristic; a moderate augmentation factor (3-5x) can effectively expand the feature space coverage, while an excessively high factor (9x) may lead to a decrease in training efficiency due to sample diversity saturation. The specificity index remains at a high level (0.80) across all configurations, indicating that the model's ability to identify negative samples is robust.

[0106] To achieve bit-plane enhancement of chestnut X-ray DR images, this study constructed an enhancement processing system based on the Dirichlet distribution, including four modules: category image preview, category bit-plane comparison analysis, image bit-plane visualization, and enhanced image preview. Figure 2 As shown, the system organizes images in the dataset by chestnut type, supporting grid browsing and batch processing. The toolbar provides "All Categories Bit-Plane Batch Processing" and "Category Statistical Analysis" functions, and... Figure 2 The module provides various bit-plane comparison and analysis. The bit-plane analysis window horizontally displays the binarized results of eight bit planes (bit 0-LSB to bit 7-MSB). The category switching panel on the left uses color coding and supports feature comparison of different defect types. Figure 3 For a planar representation of the selected image, a hierarchical feature extraction process from low-bit noise texture to high-bit binarized masks is employed. The image enhancement module includes traditional enhancement methods and the proposed bit-plane enhancement, such as... Figure 4 As shown, the parameter configuration panel offers options for augmentation method selection, weight strategy settings (exponential / linear / quadratic / uniform), concentration adjustment (0.5-10.0), and a Softplus optimization switch. Each time the user selects a number of data augmentations and clicks the generate button, the system generates the corresponding number of augmented images in real time. The augmentation results can be batch-saved to a specified directory.

[0107] Working principle: In the image acquisition module, the chestnut sample is imaged and acquired by the X-ray digital radiographic imaging system. After the X-rays penetrate the chestnut sample, a two-dimensional grayscale transmission image is formed at the detection end. By adjusting the voltage, current and exposure conditions of the X-ray tube, DR grayscale images reflecting the internal structure and density distribution characteristics of the chestnut are obtained. These images contain the fine structural information of the chestnut and are the basic data for subsequent processing.

[0108] Next, the image preprocessing module is entered. The preprocessing steps perform a series of processes on the chestnut DR grayscale image to improve image quality and prepare it for subsequent analysis. First, Gaussian filtering is applied to remove random noise generated during the imaging process while preserving the overall structural information of the image. Then, median filtering is used to remove local noise in the image to reduce its impact on subsequent processing. To further improve image quality, a background removal algorithm is used to remove interference from non-uniform backgrounds, and histogram equalization is used to enhance the grayscale contrast of the internal structure of the chestnut to ensure clearer image details. Finally, the image is sharpened to highlight edge details, and the image is uniformly scaled to a standard size to provide consistent input for subsequent bit-plane decomposition processing.

[0109] In the bit-plane decomposition module, the preprocessed chestnut DR image is decomposed into bit-planes. This process splits the grayscale information of each pixel into multiple binary bit planes. Typically, the image with grayscale values ​​ranging from 0 to 255 is decomposed into 8 bit planes. Each bit plane corresponds to a different grayscale level. The higher bit planes carry the main structural information inside the chestnut, while the lower bit planes capture the subtle textures and local density changes in the image. This decomposition method helps to extract different information levels in the image and provides richer features for subsequent image enhancement.

[0110] In the weight construction and sampling module, the importance of each bit plane is first analyzed to construct corresponding bit plane weight vectors. These weight vectors reflect the importance distribution of each bit plane in the image representation. Then, the weights are normalized to ensure that the sum of the weights of each bit plane is 1, forming a weight distribution that conforms to prior knowledge. Next, new bit plane weights are generated using the Dirichlet distribution. Based on the normalized bit plane weight vectors and the concentration parameter, sampling is performed to generate new weight vectors. This process introduces random changes in weights, which can enhance the diversity of the image while maintaining the integrity of the image information.

[0111] The image reconstruction module is responsible for weighted reconstruction of each bit plane based on the sampled bit plane weights to generate an enhanced image. The reconstructed image will undergo grayscale normalization and be mapped to the preset effective dynamic range using a minimum-maximum scaling method. This ensures that the original structure of the image is preserved and avoids insufficient image contrast caused by uneven weight distribution.

[0112] Finally, during the data augmentation process, multiple independent samplings of the Dirichlet distribution are used to generate multiple augmented images with different weight combinations for each original chestnut DR image. These augmented images provide diverse training samples through different weight combinations, greatly enriching the dataset and enhancing the robustness and generalization ability of the model. Each augmented image will contain different combinations of information from the original image, thus providing more samples for subsequent machine learning model training.

[0113] The bit-plane reconstruction method for chestnut DR image data enhancement of the present invention can generate diverse and high-quality enhancement samples through precise image preprocessing, bit-plane decomposition and weight sampling techniques, which significantly improves the diversity of the dataset and the training effect. This method is not only applicable to the enhancement of chestnut DR images, but can also be widely applied to image data enhancement in other fields, promoting the performance improvement of machine learning models in practical applications.

[0114] The above description shows and illustrates the basic principles, main features, and advantages of the present invention. Standard parts used in the present invention can be purchased from the market, and irregular parts can be customized according to the description and drawings. The specific connection methods of each part adopt conventional methods such as bolts, rivets, and welding that are mature in the prior art. The machinery, parts, and equipment adopt conventional models in the prior art, and the circuit connection adopts conventional connection methods in the prior art, which will not be described in detail here.

[0115] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A bit plane reconstruction of chestnut DR image data enhancement method, characterized in that, Comprise the following steps: S1: image acquisition step, using X-ray digital projection imaging system for imaging collection of chestnut sample, through the control X-ray tube voltage, current and exposure conditions, make X-ray penetrate chestnut sample and form two-dimensional gray scale transmission image in the detection end, thereby obtaining chestnut DR gray scale image data which can reflect the internal structure density distribution characteristics of chestnut; S2: image preprocessing step, the chestnut DR gray scale image obtained in step S1 is sequentially subjected to noise suppression and image enhancement processing, the image preprocessing includes using Gaussian filter to reduce random noise introduced by imaging system while maintaining overall structure information of the image, then reducing the influence of local abnormal noise points on subsequent processing by median filter, then weakening the interference of non-uniform background to the main body area of chestnut by background removal algorithm, and enhancing the gray scale contrast of the internal structure of chestnut by histogram equalization, finally sharpening the image to highlight the edge details, and adjusting the processed image to a uniform size; S3: bit plane decomposition step, the preprocessed chestnut DR gray scale image is decomposed according to the pixel gray scale value, the gray scale information of each pixel is split into multiple binary bit planes, so that different bit planes carry information of different gray scale levels, wherein the high bit plane is used to represent the main structural characteristics of the internal structure of chestnut, and the low bit plane is used to represent the fine texture and local density change information; S4: bit plane weight construction step, based on the importance distribution of the bit plane to the chestnut DR image information expression, a corresponding bit plane weight vector is constructed, and the weight vector is normalized to make the weight values of each bit plane satisfy the constraint condition that the sum is one, thereby forming a prior weight distribution reflecting the relative importance of the bit plane; S5: Dirichlet weight sampling step, the concentration parameters of Dirichlet distribution are constructed according to the normalized bit plane weight vector, and new bit plane weight vectors are generated by random sampling through Dirichlet distribution, so as to introduce continuous weight combination under the premise of maintaining the integrity of bit plane information; S6: image reconstruction and normalization step, according to the bit plane weight obtained by sampling in step S5, each bit plane obtained in step S3 is weighted and reconstructed to generate a new enhanced chestnut DR image, and the generated enhanced image is subjected to gray scale range normalization processing, so that its gray scale value distribution covers the preset effective dynamic range, thereby obtaining a data enhancement sample for model training.

2. The method of claim 1, wherein the method is a bit plane reconstruction method for enhancing chestnut DR image data. The X-ray digital projection imaging system in step S1 adopts a desktop X-ray scanning device for imaging, and the X-ray tube voltage is set to 50kV and the current is set to 5mA during the imaging process, and the X-ray DR gray scale image data of chestnut is obtained through a 16-bit digital data acquisition system.

3. The method of claim 1, wherein the method is a bit plane reconstruction method for enhancing chestnut DR image data. After the chestnut DR gray scale image is preprocessed in step S2, the image is uniformly scaled or cropped to a standard size of 224x224 pixels, and stored in JPG format to facilitate the consistency of subsequent bit plane decomposition and data enhancement processing.

4. The method of claim 1, wherein the method is a bit plane reconstruction method for enhancing chestnut DR image data. The bit plane decomposition in step S3 is processed for the chestnut DR image with a gray value range of 0-255, and the gray image is decomposed into 8 bit planes, each of which corresponds to a different binary weight level in the image gray value; Wherein, for the collected gray image I, the pixel intensity range is [0, 255], which is decomposed into 8 binary bit planes {B0, B1,..., B7}, wherein the extraction mode of the i-th plane Bi is: Wherein (x, y) represents the pixel coordinates, and the high-order bit plane such as B7, B6 contains the main structure information of the image, and the low-order bit plane captures more fine texture details; Let denotes the original weight vector based on the bit-plane importance analysis, where the weight value of each bit-plane is: The weight distribution reflects the importance distribution of bit-planes in the image representation. By normalizing the original weights, the weight normalization vector is obtained.

5. The method of claim 1, wherein the method is a bit plane reconstruction method for enhancing chestnut DR image data. In the bit plane weight vector constructed in step S4, each bit plane is assigned a non-zero weight, so that in the data enhancement process, any bit plane information is not completely discarded, so as to ensure the continuity of the chestnut DR image density information.

6. The method of claim 1, wherein the method is a bit plane reconstruction method for enhancing chestnut DR image data. The concentration parameter of the Dirichlet distribution in step S5 is determined by the normalized bit plane weight vector and the concentration parameter, and the concentration parameter is used to control the dispersion degree of the sampling weight relative to the original weight distribution; concentration parameter vector of the Dirichlet distribution by the normalized prior weight with concentration parameter co-determined, denoted as: Wherein, 8 is the bit plane number, is the concentration parameter, The greater the value, the more concentrated the sampling results are near , The smaller the value, the stronger the sampling randomness; Based on concentration parameters sampling from a Dirichlet distribution to generate new weight vectors : Concentration parameter The larger the value, the more concentrated the sampling results are. nearby, The smaller the value, the stronger the randomness of the sampling.

7. The method of claim 6, wherein the method is a bit plane reconstruction method for enhancing chestnut DR image data. The value of the concentration parameter is set to 2 to balance between enhancing sample diversity and weight distribution stability.

8. The method of claim 1, wherein the method is a bit plane reconstruction method for enhancing chestnut DR image data. In step S6, the gray value normalization processing of the enhanced image adopts the minimum and maximum scaling method, so that the generated enhanced image fully utilizes the entire gray dynamic range while maintaining the original structure characteristics.

9. The method of claim 1, wherein the method is a bit plane reconstruction method for enhancing chestnut DR image data. For each original chestnut DR image, a plurality of enhanced images with different weight combinations are generated by multiple independent sampling of the Dirichlet distribution, so as to realize the multiple expansion of the training data set; Given a weight vector sampled from a Dirichlet distribution and a set of bit-planes {B0, B1,..., B7} extracted from the original image I, an enhanced image is synthesized by Through the minimum-maximum scaling, it is ensured that the generated enhanced image fully utilizes the entire gray dynamic range [0, 255], effectively avoiding the problem of insufficient image contrast caused by uneven weight distribution; For each original training sample, N enhanced variants are generated by independently sampling N times from the Dirichlet distribution, so as to realize the N+1 times expansion of the training set.

10. A bit plane reconstructed chestnut DR image data enhancement system, characterized in that: Applied to the data enhancement method of any one of claims 1-9, comprising: An image acquisition module for acquiring an X-ray DR gray image of a chestnut; An image preprocessing module for filtering, background removal, contrast enhancement and size unification processing on the DR gray image; A bit plane decomposition module for decomposing the preprocessed chestnut DR image into a plurality of bit planes; A weight construction and sampling module for constructing a bit plane weight vector and generating a new bit plane weight based on a Dirichlet distribution; An image reconstruction module for weighting and reconstructing each bit plane according to the sampled bit plane weight and outputting an enhanced chestnut DR image.