Low-light food package image enhancement and identification method, system and terminal
By using a multi-scale feature extraction and fused low-light image enhancement network under low-light conditions, the problem of poor image enhancement effect of low-light food packaging in the prior art is solved, and higher quality image enhancement and recognition effects are achieved.
Patent Information
- Application Number
- CN202510281364.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-04-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art has poor enhancement processing of food packaging images under low light conditions, and failed to effectively capture local details and global structural information of the image, resulting in low image quality after enhancement.
A low-light image enhancement network is adopted, which includes a downsampling module, an upsampling module and a reconstruction module. Through multi-scale feature extraction and fusion, local details and global structural information of the image are captured, and the brightness and contrast of the image are improved through feature enhancement processing.
It effectively improves the quality of low-light food packaging images, and the enhanced images are clearer and brighter, with richer details, adapting to recognition tasks under different lighting conditions.
Smart Images

Figure CN119784655A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image enhancement technology, and in particular to a method, system and terminal for low-light food packaging image enhancement and recognition. Background Art
[0002] With the rapid development of the global food industry, food packaging plays a vital role in ensuring food safety, enhancing brand image, and optimizing supply chain management. The text information on food packaging, such as production date, shelf life, ingredient list, barcode, etc., not only provides necessary information for consumers, but also provides key data support for production companies and logistics links. Therefore, accurate and fast recognition and processing of optical characters (OCR) on these packages has become an important technical requirement in the modern food industry.
[0003] Traditional optical character recognition technology can achieve a high recognition accuracy under sufficient lighting conditions. However, in practical applications, food packaging often needs to be scanned and recognized in a variety of complex environments, such as storage environments under low-light conditions, night production lines, and mobile device usage scenarios. At present, image enhancement processing methods have been proposed to enhance low-light images. For example, the invention patent application with publication number CN116188307A and the name "Joint method and system for low-light image enhancement and semantic segmentation suitable for all day" discloses a light intensity enhancement network structure. The light intensity enhancement network extracts and reconstructs low-light images through a series of convolution and deconvolution operations, gradually restores the details and brightness information of the image, and finally outputs the reflection map and brightness map through the Sigmoid layer to achieve image enhancement processing. Although the above scheme realizes image enhancement processing to a certain extent, it fails to obtain more comprehensive feature information, and the quality of the enhanced image needs to be further improved. Summary of the invention
[0004] The purpose of the present invention is to overcome the problems of the prior art and to provide a method, system and terminal for enhancing and recognizing low-light food packaging images.
[0005] The object of the present invention is to achieve the following technical solution: a method for enhancing a low-light food packaging image, the method comprising the following steps: Establishing a low-light image enhancement network, wherein the low-light image enhancement network includes a downsampling module, an upsampling module, and a reconstruction module; A downsampling module is used to perform convolution processing, local and global feature extraction processing, and multi-scale feature downsampling processing on the input low-light image to obtain a first multi-scale feature map; the downsampling processing of each scale feature includes downsampling convolution processing, or the downsampling processing of each scale feature includes downsampling convolution processing, local and global feature extraction processing; An upsampling module is used to perform transposed convolution processing on the input low-light image and the first multi-scale feature map to obtain a first feature map, and then a multi-scale feature upsampling processing is performed on the first feature map to obtain a second multi-scale feature map; the upsampling processing of each scale feature includes local and global feature extraction processing, feature enhancement processing, or the upsampling processing of each scale feature includes local feature and global feature extraction, feature enhancement processing, and transposed convolution processing, and the input features of the upsampling processing of each scale feature also include extracted local features and global features of different scales; A reconstruction module is used to perform local and global feature extraction and convolution processing on the second multi-scale feature map to obtain a high-light image; Train the low-light image enhancement network and optimize the parameters of the low-light image enhancement network; The low-light image is enhanced using the trained low-light image enhancement network to obtain a high-light image.
[0006] In one example, the local and global feature extraction process includes: The input features are input into the convolutional neural network branch and the Transformer branch respectively. The convolutional neural network branch performs multiple convolutions on the input features. The first intermediate feature map obtained by the convolution is downsampled to obtain a second intermediate feature map with the same dimension as the Transformer branch. The second intermediate feature map is input into the Transformer branch. The Transformer branch performs feature extraction and outputs a third intermediate feature map. The third intermediate feature map is transposed and convolved to obtain a fourth intermediate feature map with the same dimension as the CNN branch. The convolutional neural network branch performs multiple convolutions on the fourth intermediate feature map to output local and global features.
[0007] In one example, the feature enhancement process includes: The input features are processed by multi-scale convolution and then spliced. The spliced feature maps are input into the convolution block attention module for multi-scale feature fusion to obtain refined features.
[0008] It should be further explained that the technical features corresponding to the above-mentioned image enhancement method examples can be combined or replaced with each other to form a new technical solution.
[0009] The present invention also includes a low-light food packaging image enhancement system, the image enhancement system comprising: The first network construction unit is used to establish a low-light image enhancement network; the low-light image enhancement network includes a downsampling module, an upsampling module and a reconstruction module; the downsampling module includes a first convolutional layer, a first local and global feature extraction block, and a multi-scale feature downsampling group connected in sequence, the first convolutional layer receives an input low-light image, and the multi-scale feature downsampling group outputs a first multi-scale feature map; the multi-scale feature downsampling group includes a multi-scale feature downsampling block, each scale feature downsampling block includes a downsampling convolution layer, or each scale feature downsampling block includes a downsampling convolution layer, a local and global feature extraction block; the upsampling module includes a first transposed convolutional layer, a multi-scale feature upsampling group, a multi-scale feature downsampling group, and a multi-scale feature downsampling group. The feature upsampling group includes a multi-scale feature upsampling block, a first transposed convolution layer receives an input low-light image and a first multi-scale feature map, and the multi-scale feature upsampling group outputs a second multi-scale feature map; the multi-scale feature upsampling block includes a local and global feature extraction block group, a feature enhancement layer, or the multi-scale feature upsampling block includes a local and global feature extraction block group, a feature enhancement processing layer and a transposed convolution layer, and the input end of each multi-scale feature upsampling block is connected to the output end of different local and global feature extraction blocks; the reconstruction module includes a fifth local and global feature extraction block and a plurality of convolution layers connected in sequence, and is used to perform image reconstruction processing on the second multi-scale feature map, and then output a high-light image; A first training unit is used to train a low-light image enhancement network and optimize parameters of the low-light image enhancement network; The image enhancement unit is used to enhance the low-light image by using the trained low-light image enhancement network to obtain a high-light image.
[0010] In one example, the local and global feature extraction block includes a convolutional neural network branch and a Transformer branch, the convolutional neural network branch includes a first convolution group and a second convolution group, the Transformer branch is a Transformer encoding block, the first convolution group is connected to the input end of the Transformer encoding block via a downsampling processing block, and the output end of the Transformer encoding block is connected to the second convolution group via a transposed convolution block.
[0011] In one example, the feature enhancement block includes a third convolution group, a first concatenation layer, and a convolution block attention module, and the third convolution group includes multiple parallel convolution layers.
[0012] It should be further explained that the technical features corresponding to the above-mentioned image enhancement system examples can be combined or replaced with each other to form a new technical solution.
[0013] The present invention also includes a low-light food packaging image recognition method, which is implemented based on an image enhancement method formed by any one of the above examples or a combination of multiple examples, and the image recognition method includes the following steps: Training an image recognition model to optimize parameters of the image recognition model; the image recognition model includes one or more of an optical character recognition model, a semantic segmentation model, an image classification model, and a target detection model; The image recognition model is used to perform image recognition processing on the high-light image to obtain the image recognition result.
[0014] In one example, training of an image recognition model is replaced by joint training of a low-light image enhancement network and an image recognition model, including: The image recognition model is pre-trained using an image dataset under normal lighting conditions. After the pre-training is completed, all trainable parameters in the image recognition model are frozen, and the parameters of the low-light image enhancement network are updated so that the low-light image enhancement network outputs a high-light image that can be recognized by the image recognition model. The high-light image is input into the image recognition model to obtain the image recognition result. The joint training loss used in the joint training is the weighted sum of the reconstruction loss of the low-light image enhancement network, the first feature perception loss of the image recognition model, the classification loss of the image recognition model, and the label loss of the image recognition model.
[0015] It should be further explained that the technical features corresponding to the various examples of the above-mentioned image recognition method can be combined or replaced with each other to form a new technical solution.
[0016] The present invention also includes a low-light food packaging image recognition system, the image recognition system comprising: A second training unit is used to train an image recognition model and optimize parameters of the image recognition model; the image recognition model includes one or more of an optical character recognition model, a semantic segmentation model, an image classification model, and a target detection model; The image recognition unit is used to perform image recognition processing on the high-light image using an image recognition model to obtain an image recognition result.
[0017] It should be further explained that the technical features corresponding to the above examples can be combined or replaced with each other to form a new technical solution.
[0018] The present invention also includes a terminal, including a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, and when the processor executes the computer instructions, the steps of the low-light food packaging image enhancement method formed by any one or more of the above examples are executed.
[0019] Compared with the prior art, the present invention has the following beneficial effects: 1. In one example, the low-light image enhancement network extracts and fuses multi-scale features through the downsampling module and the upsampling module respectively, which can effectively capture the local details and global structural information in the image. Therefore, when enhancing the low-light image, it not only retains the image's detailed texture, but also maintains the overall structural consistency, thereby improving the image quality; the useful features of the image are enhanced through feature enhancement processing, so that the brightness and contrast of the image are improved. At the same time, the local and global features are further extracted and convolved in the reconstruction module, which optimizes the image reconstruction process, making the enhanced high-light image clearer and brighter, with richer details.
[0020] 2. In one example, the CNN branch captures the local features and spatial information of the image, and the Transformer branch can effectively extract the global features and long-distance dependencies. The downsampling and transposed convolution operations are combined to perform dimensionality conversion, so that the feature map dimensions of the CNN branch and the Transformer branch remain consistent, which facilitates information interaction and fusion between features, enhances the comprehensive processing capabilities of local and global features, and can improve the accuracy and robustness of feature extraction.
[0021] 3. In one example, through multi-scale convolution processing, it is possible to capture detailed information of different scales in the image, so as to have a more comprehensive understanding of the image content; the spliced feature map is input into the convolution block attention module, and the features are weighted and screened using the attention mechanism to obtain refined features containing rich image information, which provides high-quality input for subsequent image recognition tasks and is conducive to obtaining more accurate image recognition results.
[0022] 4. In one example, a low-light image enhancement network and an image recognition model are jointly trained. Under the guidance of high-level information such as the position and content of text in the image fed back by the image recognition model, the low-light image enhancement network can better understand and predict the characteristics of images under low-light conditions, and then continuously optimize to generate high-light images that are more suitable for processing by the image recognition model. This method not only improves the accuracy of low-light image recognition tasks, but also enhances the robustness and generalization ability of the image recognition model under different lighting conditions, so that it can adapt to different environmental conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The specific implementation methods of the present invention are further described in detail below in conjunction with the accompanying drawings. The accompanying drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The same reference numerals are used in these drawings to represent the same or similar parts. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.
[0024] Figure 1 A method flow chart provided for an example of the present invention; Figure 2 A schematic diagram of a low-light image enhancement network structure provided for an example of the present invention; Figure 3 A schematic diagram of a local and global feature extraction block structure provided for an example of the present invention; Figure 4 A schematic diagram of a feature enhancement block structure provided for an example of the present invention; Figure 5 A schematic diagram of a DB network structure provided for an example of the present invention; Figure 6 A schematic diagram of the structure of a convolutional recurrent neural network provided for an example of the present invention; Figure 7 A schematic diagram of a joint training framework provided for an example of the present invention. DETAILED DESCRIPTION
[0025] The technical solution of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] In the description of the present invention, it should be noted that the directions or positional relationships indicated by "center", "up", "down", "left", "right", "inside", "outside", etc. are directions or positional relationships based on the drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the use of ordinal numbers (e.g., "first and second", "first to fourth", etc.) is to distinguish objects, and is not limited to this order, and cannot be understood as indicating or implying relative importance.
[0027] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, "connection" should be understood in a broad sense, for example, it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood in specific circumstances.
[0028] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0029] In one example, if Figure 1As shown, a low-light food packaging image enhancement method can be used to identify different types of images, including low-light food packaging images, low-light commodity label images, and other low-light images. The specific embodiment of the present invention illustrates the inventive concept of the method by processing the food packaging recognition task under low light. The method includes the following steps: S1: Establish a low-light image enhancement network (LLIENet).
[0030] Among them, the low-light image enhancement network includes a downsampling module, an upsampling module and a reconstruction module.
[0031] The downsampling module includes a first convolution layer, a first local and global feature extraction block, and a multi-scale feature downsampling group connected in sequence. The first convolution layer receives the input low-light image, and the multi-scale feature downsampling group outputs a first multi-scale feature map; the multi-scale feature downsampling group includes a multi-scale feature downsampling block, each scale feature downsampling block includes a downsampling convolution layer, or each scale feature downsampling block includes a downsampling convolution layer, a local and global feature extraction block. Figure 2 As shown, the downsampling module is a U-shaped feature extraction structure, including the first convolution layer, the first local and global feature extraction block (the first CNN-Trans block, CNN is a convolutional neural network branch, and Trans represents a Transformer branch), the first downsampling convolution layer, the second local and global feature extraction block (the second CNN-Trans block), the second downsampling convolution layer, the third local and global feature extraction block (the third CNN-Trans block), and the third downsampling convolution layer, which are sequentially connected. The first downsampling convolution layer and the second local and global feature extraction block constitute a first scale feature downsampling block, the second downsampling convolution layer and the third local and global feature extraction block constitute a second scale feature downsampling block, and the second downsampling convolution layer is a third scale feature downsampling block. The downsampling convolution in each scale feature downsampling block is a 2×2 convolution with a stride of 2. In this example, the downsampling module is used to perform a 1×1 convolution layer preprocessing on the input low-light image, and then the image is transferred to the first local and global feature extraction block to extract local and global features, and then the depth downsampling of three scales is performed to obtain the first multi-scale feature map. The downsampling process of each scale feature includes downsampling convolution process, or the downsampling process of each scale feature includes downsampling convolution process, local and global feature extraction process.
[0032] The upsampling module includes a first transposed convolution layer and a multi-scale feature upsampling group. The first transposed convolution layer receives the input low-light image and the first multi-scale feature map, and the multi-scale feature upsampling group outputs a second multi-scale feature map. The multi-scale feature upsampling group includes a multi-scale feature upsampling block, and the multi-scale feature upsampling block includes a local and global feature extraction block group, a feature enhancement layer, or a multi-scale feature upsampling block includes a local and global feature extraction block group, a feature enhancement processing layer, and a transposed convolution layer. The input end of each multi-scale feature upsampling block is connected to the output end of different local and global feature extraction blocks to realize feature fusion processing. Figure 2 As shown, the upsampling module includes a first transposed convolution layer, a first local and global feature extraction block group (first CNN-Trans block group), a first feature enhancement block, a second transposed convolution layer, a second local and global feature extraction block group (second CNN-Trans block group), a second feature enhancement block, a third transposed convolution layer, a fourth local and global feature extraction block (fourth CNN-Trans block), and a third feature enhancement block. The first local and global feature extraction block group and the second local and global feature extraction block group each include two sequentially connected local and global feature extraction blocks. The first local and global The feature extraction block group, the first feature enhancement block, and the second transposed convolution layer constitute a first scale feature upsampling block, the second local and global feature extraction block group, the second feature enhancement block, and the third transposed convolution layer constitute a second scale feature upsampling block, the fourth local and global feature extraction block and the third feature enhancement block constitute a third scale feature upsampling block, the first local and global feature extraction block is connected to the fourth local and global feature extraction block, the second local and global feature extraction block is connected to the second local and global feature extraction block group, and the third local and global feature extraction block is connected to the first local and global feature extraction block group. In the upsampling module, the input low-light image and the first multi-scale feature map are first transposed convolutionally processed through a 2×2 transposed convolution layer with a stride of 2 to obtain a first feature map, and then the first feature map is subjected to multi-scale feature upsampling to obtain a second multi-scale feature map. Among them, the upsampling processing of each scale feature includes local and global feature extraction processing, feature enhancement processing, or the upsampling processing of each scale feature includes local feature and global feature extraction, feature enhancement processing, and 2×2 transposed convolution processing with a stride of 2, and the upsampling processing of each scale feature includes feature fusion processing with the corresponding local features and global features, and then the original down-sampled features are deeply upsampled to obtain a second multi-scale feature map of a larger scale.
[0033] The reconstruction module includes a fifth local and global feature extraction block, multiple convolutional layers connected in sequence, such as Figure 3As shown, the reconstruction module includes the fifth local and global feature extraction block, the second convolution layer, and the third convolution layer connected in sequence, and the third convolution layer outputs a highlight image that can be recognized by the optical character recognition network. In this example, the reconstruction module is used to perform local and global feature extraction processing on the second multi-scale feature map to obtain pure features, and then the features are input into two 1×1 convolution layers to realize the reconstruction of the three-channel highlight image, thereby obtaining a highlight image.
[0034] S2: Train the low-light image enhancement network and optimize the parameters of the low-light image enhancement network.
[0035] Specifically, the preprocessed low-light image dataset is used to train the low-light image enhancement network. First, the parameters of the low-light image enhancement network, such as weights, biases, scaling factors, etc., are initialized. The low-light image is input into the network for forward propagation to obtain an enhanced image. Then, the loss value of the network is calculated according to the loss function, and back propagation is performed based on the loss value to calculate the gradient of the network parameters. The network parameters are updated using an optimization algorithm such as Adam to minimize the loss and complete the training of the network.
[0036] S3: Use the trained low-light image enhancement network to enhance the low-light image to obtain a high-light image.
[0037] The low-light image is input into the trained low-light image enhancement network, and data enhancement processing is performed on the low-light image through the low-light image enhancement network to improve the brightness, contrast, details, etc. of the low-light image, and then a high-light image is output, which is beneficial to subsequent image recognition tasks, such as recognizing characters in the image, classifying and recognizing the image, semantically recognizing the image, or detecting targets in the image.
[0038] In one example, the local and global feature extraction processing is implemented by a local and global feature extraction block, the local and global feature extraction block includes a convolutional neural network (CNN) branch and a Transformer branch, the convolutional neural network branch includes a first convolution group and a second convolution group, the Transformer branch is a Transformer encoding block, the first convolution group is connected to the input end of the Transformer encoding block via a downsampling processing block, and the output end of the Transformer encoding block is connected to the second convolution group via a transposed convolution block. Specifically, Figure 3As shown, the local and global feature extraction block includes a transform layer, which is used to transform the input feature map and then input it into the CNN branch and the Transformer branch. The CNN branch includes a first convolution group and a second convolution group connected in sequence. The first convolution group includes a 1×1 first convolution-batch normalization layer, a 3×3 second convolution-batch normalization layer, and a 1×1 third convolution-batch normalization layer. The second convolution group includes a 1×1 fourth convolution-batch normalization layer, a 3×3 fifth convolution-batch normalization layer, and a 1×1 sixth convolution-batch normalization layer. The input end residual of the first convolution-batch normalization layer is connected to the input end of the fourth convolution-batch normalization layer, and the input end residual of the fourth convolution-batch normalization layer is connected to the output end of the sixth convolution-batch normalization layer. Each convolution group uses a residual connection to reduce information loss and gradient disappearance. Optionally, the convolution-batch normalization layer can be replaced by a convolution layer. The Transformer encoding block of the Transformer branch includes the second normalization layer, multi-head self-attention layer, third normalization layer, and multi-layer perceptron connected in sequence. The input residual of the second normalization layer is connected to the input of the third normalization layer, and the input residual of the third normalization layer is connected to the output of the multi-layer perceptron. The downsampling processing block includes the first normalization layer, the fourth downsampling convolution layer, and the fourth convolution layer connected in sequence. The output of the second convolution-batch normalization layer is connected to the first normalization layer, and the output of the fourth convolution layer is connected to the second normalization layer. The feature map extracted by the CNN branch is downsampled to the feature map of the same dimension as the Transformer branch through the downsampling processing block and then enters the Transformer branch. The transposed convolution block includes a first batch normalization layer, a fifth convolution layer, and a fourth transposed convolution layer connected in sequence, the output end of the multilayer perceptron is connected to the first batch normalization layer, the output end of the fourth transposed convolution layer is connected to the fifth convolution-batch normalization layer, and the feature map output by the Transformer branch is converted into a feature map of the same dimension as the CNN branch by the transposed convolution block and then sent to the second convolution group of the CNN branch. Specifically, the local and global feature extraction processing of the present invention is to input the input features into the convolutional neural network branch and the Transformer branch respectively after the conversion processing, the convolutional neural network branch performs multiple convolution processing on the input features, and the first intermediate feature map obtained by the convolution processing is downsampled to obtain a second intermediate feature map with the same dimension as the Transformer branch. The second intermediate feature map is input into the Transformer branch, and the Transformer branch outputs a third intermediate feature map after feature extraction processing, and the third intermediate feature map is transposed convolution processing is performed on the third intermediate feature map to obtain a fourth intermediate feature map with the same dimension as the CNN branch. The convolutional neural network branch performs multiple convolution processing on the fourth intermediate feature map and outputs local and global features.It should be noted that the CNN branch is mainly responsible for extracting local features, that is, capturing local information in the input features through multiple convolution operations; the Transformer branch is mainly responsible for extracting global features, capturing the global dependencies between features through the self-attention mechanism. During the entire feature extraction process, local features and global features are processed and interacted by different branches, and feature fusion is performed to provide rich feature representations for subsequent tasks.
[0039] In one example, feature enhancement processing is implemented by a feature enhancement (FE) block, such as Figure 4 As shown in the figure, the feature enhancement block includes the third convolution group, the first concatenation layer and the convolutional block attention module (CBAM). The third convolution group includes the seventh convolution layer of 3×3, the eighth convolution layer of 5×5 and the ninth convolution layer of 7×7 in parallel. The output ends of the seventh convolution layer, the eighth convolution layer and the ninth convolution layer are all connected to the first concatenation layer. The convolutional block attention module includes a channel attention module and a spatial attention module. The channel attention module obtains the global spatial information of the input feature map in the channel dimension through global average pooling and global maximum pooling operations, and then sends these two global spatial information to the shared multi-layer perceptron (MLP) for processing, and finally generates the channel attention weight; the spatial attention module obtains refined features by weighting different channel features to strengthen the feature channels that contribute more to the current task, so that the feature representation is more focused on the target information and reduces the interference of noise and redundant information. The feature enhancement processing in this example is to perform multi-scale convolution processing on the input features and then splice them, and input the spliced feature map into the convolution block attention module to perform multi-scale feature fusion to obtain refined features.
[0040] In one example, the present invention also includes a low-light food packaging image enhancement system, which has the same inventive concept as the low-light food packaging image enhancement method formed by any one of the above examples or a combination of multiple examples. In this case, the image enhancement system includes a first network construction unit, a first training unit and an image enhancement unit.
[0041] Among them, the first network construction unit is used to establish a low-light image enhancement network. The low-light image enhancement network includes a downsampling module, an upsampling module and a reconstruction module. The downsampling module includes a first convolutional layer, a first local and global feature extraction block, and a multi-scale feature downsampling group connected in sequence. The first convolutional layer receives the input low-light image, and the multi-scale feature downsampling group outputs a first multi-scale feature map; the multi-scale feature downsampling group includes a multi-scale feature downsampling block, each scale feature downsampling block includes a downsampling convolutional layer, or each scale feature downsampling block includes a downsampling convolutional layer, a local and global feature extraction block. The upsampling module includes a first transposed convolution layer, a multi-scale feature upsampling group, the multi-scale feature upsampling group includes a multi-scale feature upsampling block, the first transposed convolution layer receives the input low-light image and the first multi-scale feature map, and the multi-scale feature upsampling group outputs a second multi-scale feature map; the multi-scale feature upsampling block includes a local and global feature extraction block group, a feature enhancement layer, or the multi-scale feature upsampling block includes a local and global feature extraction block group, a feature enhancement processing layer and a transposed convolution layer, and the input end of each multi-scale feature upsampling block is connected to the output end of different local and global feature extraction blocks. The reconstruction module includes a fifth local and global feature extraction block and multiple convolution layers connected in sequence, which are used to perform image reconstruction processing on the second multi-scale feature map, and then output a high-light image.
[0042] Preferably, the specific structures of the downsampling module, upsampling module and reconstruction module in the low-light image enhancement network are as follows: Figure 2 As shown, the specific embodiments have been described in detail above and will not be repeated here.
[0043] Furthermore, the first training unit is used to train the low-light image enhancement network and optimize the parameters of the low-light image enhancement network. Specifically, the low-light image enhancement network is trained using the preprocessed low-light image data set. The parameters of the low-light image enhancement network, such as weights, biases, scaling factors, etc., are first initialized. The low-light image is input into the network for forward propagation to obtain an enhanced image. The loss value of the network is then calculated according to the loss function, and back propagation is performed according to the loss value to calculate the gradient of the network parameters. The network parameters are updated using an optimization algorithm such as Adam to minimize the loss and complete the training of the network.
[0044] Furthermore, the image enhancement unit is used to enhance the low-light image using the trained low-light image enhancement network to obtain a high-light image. Specifically, the low-light image is input into the trained low-light image enhancement network, and the low-light image is enhanced by the low-light image enhancement network to improve the brightness, contrast, details, etc. of the low-light image, and then the high-light image is output, which is beneficial to subsequent image recognition tasks, such as character recognition in the image, or classification recognition, semantic recognition, target detection, etc. of the image.
[0045] In one example, the local and global feature extraction block includes a convolutional neural network branch and a Transformer branch, the convolutional neural network branch includes a first convolution group and a second convolution group, the Transformer branch is a Transformer encoding block, the first convolution group is connected to the input end of the Transformer encoding block via a downsampling processing block, and the output end of the Transformer encoding block is connected to the second convolution group via a transposed convolution block. Preferably, the specific structure of the local and global feature extraction block is as follows: Figure 3 As shown, the specific embodiments have been described in detail above and will not be repeated here.
[0046] In one example, the feature enhancement block includes a third convolution group, a first concatenation layer, and a convolution block attention module, and the third convolution group includes a plurality of parallel convolution layers. Preferably, the specific structure of the feature enhancement block is as follows: Figure 4 As shown, the specific embodiments have been described in detail above and will not be repeated here.
[0047] The present invention also includes a low-light food packaging image recognition method, which is implemented based on an image enhancement method formed by any one of the above examples or a combination of multiple examples. The image recognition method includes the following steps:
[0048] S10: Train the image recognition model and optimize the parameters of the image recognition model.
[0049] The image recognition model includes one or more of an optical character recognition (OCR) model, a semantic segmentation model, an image classification model, and an object detection model. The optical character recognition model may be a convolutional recurrent neural network (CRNN), an ultra-lightweight optical character recognition model PP-OCR, etc.; the semantic segmentation model may be U-Net, DeepLab V3+, etc.; the image classification model may be VGGNet, AlexNet, ResNet, etc. The object detection model may be YOLO, Faster R-CNN, SSD, etc.
[0050] When training an image recognition model, the image recognition model is trained using a preprocessed training data set, which is a collection of high-light images and / or normal-light images. The parameters of the image recognition model, such as weights, biases, scaling factors, etc., are first initialized, and the image recognition model is forward propagated to obtain an enhanced image. The loss value of the model is then calculated based on the loss function, and backpropagation is performed based on the loss value to calculate the gradient of the model parameters. The model parameters are updated using an optimization algorithm such as Adam to minimize the loss and complete the training of the model.
[0051] S20: Perform image recognition processing on the high-light image using the image recognition model to obtain an image recognition result.
[0052] The highlight image is input into the trained image recognition model, and the image recognition model is used to perform data recognition processing on the highlight image, such as recognizing characters in the image, classifying the image, semantically recognizing the image, or detecting targets in the image, and outputting the image recognition result.
[0053] In one example, training of an image recognition model is replaced by joint training of a low-light image enhancement network and an image recognition model, including:
[0054] The image recognition model is pre-trained using an image dataset under normal lighting conditions. After the pre-training is completed, all trainable parameters in the image recognition model, including weights, biases, etc., are frozen, and the parameters of the low-light image enhancement network, such as weights, are updated so that the low-light image enhancement network outputs a high-light image that the image recognition model can recognize. The high-light image is input into the image recognition model to obtain the image recognition result.
[0055] The joint training loss used in the joint training is the weighted sum of the reconstruction loss of the low-light image enhancement network, the first feature perception loss of the image recognition model, the classification loss of the image recognition model, and the label loss of the image recognition model.
[0056] The joint learning method aims to enable the image recognition model to guide the restoration process (image reconstruction process) of the low-light image enhancement network, so that the low-light image enhancement network can reconstruct a high-light image that is more suitable for the image recognition model, and improve the accuracy of the image recognition model. In the joint training strategy, the pre-trained image recognition model plays the role of a supervisor to guide the low-light image enhancement network to train, while the low-light image enhancement network, as a student, continuously optimizes using the feedback information of the image recognition model (information such as the position and content of the text in the image), and expects to achieve the goal required by the image recognition model. Specifically, given a low-light image, the low-light image enhancement network is first applied to enhance the input image, and then the enhanced result (high-light image) is sent to the image recognition model to perform the image recognition task, and then the image recognition result is output. In summary, the goals of the method of the present invention are: 1) Under the guidance of the high-level information of the image recognition model, a visually good high-light image is reconstructed as the output of the low-light image enhancement model. 2) Achieve good accuracy in the low-light image recognition task.
[0057] Furthermore, in order to improve the image quality from both qualitative and quantitative perspectives, the reconstruction loss is calculated based on the structural similarity, feature perception, color space difference, and frequency difference between the enhanced highlight image and the normal light image. The mean absolute error (MAE) loss function is used to calculate the difference between the feature representations of the enhanced highlight image and the normal light image, and then the first feature perception loss is calculated. The cross entropy loss function is used to calculate the difference between the class probability distribution predicted by the image recognition model and the true label, and then the classification loss is calculated. The cross entropy loss function is used to calculate the label difference based on the enhanced highlight image and the normal light image, and then the label loss is calculated.
[0058] The technical concept of the image recognition method of the present invention is now explained by taking the image recognition model as an optical character recognition model as an example. The optical character recognition model, namely the OCR model, includes a text detection network and a character recognition network. The text detection network performs text detection on the input high-light image and extracts the character image, and the character recognition subnetwork recognizes the input character image to obtain the text recognition result. Optionally, the text detection network is a Differentiable Binarization (DB) network, and the character recognition network is a convolutional recurrent neural network CRNN, and the two parts jointly complete the OCR task.
[0059] The present invention introduces a feature enhancement block in the DB network to perform feature enhancement processing on the features before splicing at each level. Figure 5As shown, the DB network includes a feature pyramid backbone network, multiple upsampling layers, a feature enhancement block group and a differentiable binarization (DB) module. The feature enhancement block group includes a fourth feature enhancement block, a fifth feature enhancement block, a sixth feature enhancement block and a seventh feature enhancement block. The specific structure of each feature enhancement block is as follows Figure 4 As shown, no further details are given here. Among them, the feature pyramid backbone network performs multiple convolution and pooling operations (multi-scale feature extraction) on the high-light image to generate a series of feature maps of different scales, which are 1 / 2, 1 / 4, 1 / 8, 1 / 16, and 1 / 32 in size. The feature maps of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 in size are upsampled through multiple upsampling layers to obtain four upsampled feature maps of the same size. The feature maps of the same size are then enhanced through the fourth feature enhancement block, the fifth feature enhancement block, the sixth feature enhancement block, and the seventh feature enhancement block. The four feature maps of the same size are cascaded through the second splicing layer to obtain a fused feature map; the probability map and threshold map of the text area are predicted based on the fused feature map, and the DB module calculates an approximate binary map based on the probability map and the threshold map, and then generates a bounding box of the text to obtain a character image.
[0060] Furthermore, after upsampling the feature maps of sizes 1 / 4, 1 / 8, 1 / 16, and 1 / 32 through multiple upsampling layers, four upsampled feature maps of the same size are obtained, specifically including: The feature maps of sizes 1 / 16 and 1 / 32 are upsampled once and then element-summed to obtain a first intermediate upsampled feature map, the first intermediate upsampled feature map is upsampled twice and the feature map of size 1 / 8 is upsampled once and then element-summed to obtain a second intermediate upsampled feature map, the second intermediate upsampled feature map is upsampled twice and the feature map of size 1 / 4 is upsampled once and then element-summed to obtain a third intermediate upsampled feature map, the third intermediate upsampled feature map is convolved to obtain the first upsampled feature map, the second intermediate upsampled feature map is convolved and upsampled twice to obtain the second upsampled feature map, the first intermediate upsampled feature map is convolved and upsampled four times to obtain the third upsampled feature map, the feature map of size 1 / 32 is convolved and upsampled eight times to obtain a fourth upsampled feature map, and the sizes of the first upsampled feature map, the second upsampled feature map, the third upsampled feature map and the fourth upsampled feature map are the same.
[0061] Furthermore, if Figure 6As shown, the convolutional recurrent neural network includes a sequentially connected convolutional pooling group, an eleventh convolutional layer, a twelfth convolutional layer, a second maximum pooling layer, a convolutional batch normalization group, a third maximum pooling layer, a fourteenth convolutional layer, a mapping to sequence layer, a first bidirectional long short-term memory network, a second bidirectional long short-term memory network and a transcription layer (Transcription), the convolutional pooling group includes two convolutional pooling blocks, the convolutional pooling block includes a sequentially connected tenth convolutional layer and a first maximum pooling layer, the convolutional batch normalization group includes two convolutional batch normalization blocks, and the convolutional batch normalization block includes a sequentially connected thirteenth convolutional layer and a second batch normalization layer. Through the convolutional recurrent neural network with the above structure, the input character image is subjected to convolution processing, maximum pooling processing and batch normalization processing to extract local features, and the extracted local feature input is mapped to the sequence layer for serialization processing to obtain a feature vector. The character dependency and context information in the feature vector are captured through the first bidirectional long short-term memory network and the second bidirectional long short-term memory network, and then the character dependency and context information are decoded through the transcription layer to obtain the text recognition result.
[0062] At this time, first establish Figure 2-Figure 4 The low-light image enhancement network shown in Figure 5-Figure 6 The OCR model shown in the figure is then jointly trained with the low-light image enhancement network and the OCR model. Figure 7 As shown, that is, the optical character recognition model is pre-trained using an image dataset under normal lighting conditions. After the pre-training is completed, all trainable parameters in the optical character recognition model are frozen, and the parameters of the low-light image enhancement network are updated so that the low-light image enhancement network outputs a high-light image that the optical character recognition model can recognize. The high-light image is input into the optical character recognition model to obtain the optical character recognition result. The joint training loss used in the joint training process is the weighted sum of the reconstruction loss of the low-light image enhancement network, the first feature perception loss of the optical character recognition model, the classification loss of the optical character recognition model, and the label loss of the optical character recognition model. Finally, the low-light image enhancement network and the OCR model that have completed the joint training are used to perform the low-light enhancement task and the optical character recognition task respectively to obtain the final optical character recognition result, that is, to recognize the text information in the low-light image.
[0063] At this point, the reconstruction loss of the low-light image enhancement network The calculation expression is: ; in, is the color space difference loss, is the hyperparameter of color space difference loss; is the image frequency domain difference loss, is the hyperparameter of the image frequency domain difference loss; Second feature perceptual loss for image enhancement in low-light image enhancement networks, is the hyperparameter of the second perceptual loss; is the image structure similarity loss, is the hyperparameter of the image structure similarity loss.
[0064] Specifically, for color space difference loss In order to make the enhanced high-light image and normal-light image as consistent as possible in the image space domain, the prediction error of the image is measured in the HSV and HSI color spaces respectively, and the color space difference loss The calculation expression is: ; in represents LLIENet; LL is the input low-light image; and They are the representations of the enhanced high-light image and normal-light image in the HSV color space, respectively; and They represent the enhanced highlight image and normal illumination image in the HSI color space respectively.
[0065] For image frequency domain difference loss , is a high-frequency component loss function used to measure the error of high-frequency components between the enhanced high-light image and the normal-light image. The present invention uses the difference in high-frequency components between the enhanced high-light image and the normal-light image in the horizontal and vertical directions as the image frequency domain loss. The specific calculation formula is as follows: ; in, and They represent the high-frequency components of the enhanced high-light image and normal-light image in the horizontal and vertical directions, respectively.
[0066] In order to further evaluate the difference between images, the present invention also introduces the second feature perception loss when the low-light image enhancement network performs image enhancement processing, which is used to measure the feature similarity between the enhanced high-light image and the normal-light image. The calculation expression is: ; in, , and Represent the image width, height and number of channels respectively; Respectively represent the image width index, image height index and image channel number index; It is a pre-trained ultra-deep convolutional network (VGG neural network) for large-scale image recognition; represents the output of the low-light image enhancement network; Represents the feature representation of a normal lighting image extracted by a pre-trained VGG neural network.
[0067] For image structure similarity loss , the calculation expression is: ; ; in, represents the structural similarity index; LL is the low-light image; is a normal lighting image; Indicates different images that need to be measured; , Respectively represent images ,image The average pixel value of and Respectively represent images ,image The variance of Representing images ,image The covariance of and are two constants. =0.01 2 , =0.03 2 .
[0068] Furthermore, the first feature perceptual loss of the OCR model The calculation expression is: ; ; in, represents the first feature-perceptual loss, which is the cumulative sum of multiple feature-perceptual loss items; represents a single feature perception loss, including the difference between 1 / 4 feature maps of the enhanced high-light image and the normal-light image processed by the two OCR models respectively, the difference between 1 / 8 feature maps of the enhanced high-light image and the normal-light image processed by the two OCR models respectively, the difference between 1 / 16 feature maps of the enhanced high-light image and the normal-light image processed by the two OCR models respectively, the difference between 1 / 32 feature maps of the enhanced high-light image and the normal-light image processed by the two OCR models respectively, the difference between the feature representations of the enhanced high-light image and the normal-light image output by the eleventh convolutional layers of the two OCR models respectively, the difference between the feature representations of the enhanced high-light image and the normal-light image output by the thirteenth convolutional layers of the two OCR models respectively, the difference between the feature representations of the enhanced high-light image and the normal-light image output by the mapping-to-sequence layers of the two OCR models respectively, and the difference between the feature representations of the enhanced high-light image and the normal-light image output by the transcription layers of the two OCR models respectively; represents the mean absolute error loss function; It is the feature representation of the enhanced high-light image; It is the feature representation of the normal illumination image; Represents the number of feature extraction stages (the number of stages for multi-stage network architectures).
[0069] The reconstruction loss , the first feature perception loss Calculate the examples to combine and get the joint training loss The calculation expression is: ; The cross entropy loss function is used to calculate the difference between the character category probability distribution predicted by the OCR model and the true label, and then the classification loss is calculated. ; The cross entropy loss function is used to calculate the label difference between the enhanced high-light image and the normal-light image, and then the label loss is calculated .
[0070] In one example, the present invention also includes a low-light food packaging image recognition system, which includes a second training unit and an image recognition unit. The second training unit is used to train the image recognition model and optimize the parameters of the image recognition model. The image recognition unit is used to perform image recognition processing on the high-light image using the image recognition model to obtain an image recognition result. Optionally, the image recognition system also includes a second network construction unit, which is used to construct an image recognition model, such as an optical character recognition model, a semantic segmentation model, an image classification model, an object detection model, etc.
[0071] Preferably, the low-light food packaging image recognition system further includes a first network construction unit, a first training unit and an image enhancement unit. The first network construction unit is used to establish a low-light image enhancement network; the first training unit is used to train the low-light image enhancement network and optimize the parameters of the low-light image enhancement network; the image enhancement unit is used to enhance the low-light image using the trained low-light image enhancement network to obtain a high-light image.
[0072] Optionally, the second training unit is replaced by a joint training unit for joint training of the low-light image enhancement network and the image recognition model. Specifically, the image recognition model is pre-trained using an image dataset under normal lighting conditions. After the pre-training is completed, all trainable parameters in the image recognition model are frozen, and the parameters of the low-light image enhancement network are updated so that the low-light image enhancement network outputs a high-light image that can be recognized by the image recognition model. The high-light image is input into the image recognition model to obtain an image recognition result. The joint training loss used in the joint training is the weighted sum of the reconstruction loss of the low-light image enhancement network, the first feature perception loss of the image recognition model, the classification loss of the image recognition model, and the label loss of the image recognition model.
[0073] The present invention also provides a terminal, which has the same inventive concept as any example or combination of multiple examples corresponding to the above-mentioned low-light food packaging image enhancement method or low-light food packaging image recognition method, including a memory and a processor, the memory stores computer instructions that can be run on the processor, and the processor executes the steps of the above-mentioned low-light food packaging image enhancement method or low-light food packaging image recognition method when running the computer instructions. The processor can be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.
[0074] In one example, the terminal, i.e., the electronic device, is presented in the form of a general-purpose computing device, and the components of the electronic device may include but are not limited to: at least one processing unit (processor) mentioned above, at least one storage unit mentioned above, and a bus connecting different system components (including storage units and processing units).
[0075] The storage unit stores a program code, and the program code can be executed by the processing unit, so that the processing unit performs the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification. For example, the processing unit can perform the above-mentioned low-light food packaging image enhancement method or low-light food packaging image recognition method.
[0076] The storage unit may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 3201 and / or a cache memory unit, and may further include a read-only memory unit (ROM).
[0077] The storage unit may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0078] The bus may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0079] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may communicate with one or more devices that enable a user to interact with the electronic device, and / or may communicate with any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter. The network adapter communicates with other modules of the electronic device through a bus. It should be understood that other hardware and / or software modules may be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0080] Through the above description, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to this exemplary embodiment can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method of the exemplary embodiment of the present application.
[0081] The above specific implementation methods are detailed descriptions of the present invention. It cannot be determined that the specific implementation methods of the present invention are limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions and substitutions can be made without departing from the concept of the present invention, which should be regarded as belonging to the protection scope of the present invention.
Claims
1. A low-light food packaging image enhancement method, characterized in that: The method comprises the following steps: Establishing a low-light image enhancement network, wherein the low-light image enhancement network includes a downsampling module, an upsampling module, and a reconstruction module; A downsampling module is used to perform convolution processing, local and global feature extraction processing, and multi-scale feature downsampling processing on the input low-light image to obtain a first multi-scale feature map; the downsampling processing of each scale feature includes downsampling convolution processing, or the downsampling processing of each scale feature includes downsampling convolution processing, local and global feature extraction processing; An upsampling module is used to perform transposed convolution processing on the input low-light image and the first multi-scale feature map to obtain a first feature map, and then a multi-scale feature upsampling processing is performed on the first feature map to obtain a second multi-scale feature map; the upsampling processing of each scale feature includes local and global feature extraction processing, feature enhancement processing, or the upsampling processing of each scale feature includes local feature and global feature extraction, feature enhancement processing, and transposed convolution processing, and the input features of the upsampling processing of each scale feature also include extracted local features and global features of different scales; A reconstruction module is used to perform local and global feature extraction and convolution processing on the second multi-scale feature map to obtain a high-light image; Train the low-light image enhancement network and optimize the parameters of the low-light image enhancement network; The low-light image is enhanced using the trained low-light image enhancement network to obtain a high-light image.
2. The low-light food packaging image enhancement method according to claim 1, characterized in that: The local and global feature extraction process includes: The input features are input into the convolutional neural network branch and the Transformer branch respectively. The convolutional neural network branch performs multiple convolutions on the input features. The first intermediate feature map obtained by the convolution is downsampled to obtain a second intermediate feature map with the same dimension as the Transformer branch. The second intermediate feature map is input into the Transformer branch. The Transformer branch performs feature extraction and outputs a third intermediate feature map. The third intermediate feature map is transposed and convolved to obtain a fourth intermediate feature map with the same dimension as the CNN branch. The convolutional neural network branch performs multiple convolutions on the fourth intermediate feature map to output local and global features.
3. The low-light food packaging image enhancement method according to claim 1, characterized in that: The feature enhancement process includes: The input features are processed by multi-scale convolution and then spliced. The spliced feature maps are input into the convolution block attention module for multi-scale feature fusion to obtain refined features.
4. A low-light food packaging image enhancement system, characterized in that: The image enhancement system comprises: The first network construction unit is used to establish a low-light image enhancement network; the low-light image enhancement network includes a downsampling module, an upsampling module and a reconstruction module; the downsampling module includes a first convolutional layer, a first local and global feature extraction block, and a multi-scale feature downsampling group connected in sequence, the first convolutional layer receives an input low-light image, and the multi-scale feature downsampling group outputs a first multi-scale feature map; the multi-scale feature downsampling group includes a multi-scale feature downsampling block, each scale feature downsampling block includes a downsampling convolution layer, or each scale feature downsampling block includes a downsampling convolution layer, a local and global feature extraction block; the upsampling module includes a first transposed convolutional layer, a multi-scale feature upsampling group, a multi-scale feature downsampling group, and a multi-scale feature downsampling group. The feature upsampling group includes a multi-scale feature upsampling block, a first transposed convolution layer receives an input low-light image and a first multi-scale feature map, and the multi-scale feature upsampling group outputs a second multi-scale feature map; the multi-scale feature upsampling block includes a local and global feature extraction block group, a feature enhancement layer, or the multi-scale feature upsampling block includes a local and global feature extraction block group, a feature enhancement processing layer and a transposed convolution layer, and the input end of each multi-scale feature upsampling block is connected to the output end of different local and global feature extraction blocks; the reconstruction module includes a fifth local and global feature extraction block and a plurality of convolution layers connected in sequence, and is used to perform image reconstruction processing on the second multi-scale feature map, and then output a high-light image; A first training unit is used to train a low-light image enhancement network and optimize parameters of the low-light image enhancement network; The image enhancement unit is used to enhance the low-light image by using the trained low-light image enhancement network to obtain a high-light image.
5. The low-light food packaging image enhancement system according to claim 4, characterized in that: The local and global feature extraction block includes a convolutional neural network branch and a Transformer branch. The convolutional neural network branch includes a first convolution group and a second convolution group. The Transformer branch is a Transformer encoding block. The first convolution group is connected to the input end of the Transformer encoding block through a downsampling processing block, and the output end of the Transformer encoding block is connected to the second convolution group through a transposed convolution block.
6. The low-light food packaging image enhancement system according to claim 4, characterized in that: The feature enhancement block includes a third convolution group, a first concatenation layer and a convolution block attention module, and the third convolution group includes multiple parallel convolution layers.
7. A method for low-light food packaging image recognition, implemented based on the image enhancement method according to any one of claims 1 to 3, characterized in that: The image recognition method comprises the following steps: Training an image recognition model to optimize parameters of the image recognition model; the image recognition model includes one or more of an optical character recognition model, a semantic segmentation model, an image classification model, and a target detection model; The image recognition model is used to perform image recognition processing on the high-light image to obtain the image recognition result.
8. The low-light food packaging image recognition method according to claim 7, characterized in that: Replace the training of the image recognition model with joint training of the low-light image enhancement network and the image recognition model, including: The image recognition model is pre-trained using an image dataset under normal lighting conditions. After the pre-training is completed, all trainable parameters in the image recognition model are frozen, and the parameters of the low-light image enhancement network are updated so that the low-light image enhancement network outputs a high-light image that can be recognized by the image recognition model. The high-light image is input into the image recognition model to obtain the image recognition result. The joint training loss used in the joint training is the weighted sum of the reconstruction loss of the low-light image enhancement network, the first feature perception loss of the image recognition model, the classification loss of the image recognition model, and the label loss of the image recognition model.
9. A low-light food packaging image recognition system, characterized in that: The image recognition system comprises: A second training unit is used to train an image recognition model and optimize parameters of the image recognition model; the image recognition model includes one or more of an optical character recognition model, a semantic segmentation model, an image classification model, and a target detection model; The image recognition unit is used to perform image recognition processing on the high-light image using an image recognition model to obtain an image recognition result.
10. A terminal comprising a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, characterized in that: When the processor runs the computer instructions, it executes the steps of the low-light food packaging image enhancement method described in any one of claims 1-3, or when the processor runs the computer instructions, it executes the steps of the low-light food packaging image recognition method described in any one of claims 7-8.
Citation Information
Patent Citations
Low-illumination adjustable brightness enhancement method based on reference brightness index guidance
CN112465726A
Low-illumination image enhancement method based on multi-scale and context learning network
CN114998145A
Transform-based multi-scale optimization low-illumination image enhancement method
CN115205147A
All-day image low-illumination enhancement and semantic segmentation combined method and system
CN116188307A
Natural scene text detection method and system, storage medium and computing equipment
CN116229445A
Cited By
CNN-Transform-based low-illumination image multi-task recovery method and system
CN120495112A
A multi-task restoration method and system for low-light images based on CNN-Transformer
CN120495112B
Image recognition-based product packaging layout element extraction method
CN122618626A