Image processing method and device, computer equipment and storage medium
Through the training equipment identification model, the automatic identification of the liquefied gas equipment image is solved, and the problem of low security inspection of traditional liquefied gas is achieved, and an efficient and accurate security inspection process is achieved.
Patent Information
- Application Number
- CN202510682657.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-05-23
AI Technical Summary
Traditional liquefied gas security inspection methods rely on manual audits, are inefficient and subjective judgment deviations, and cannot efficiently identify whether the equipment image complies with security inspection specifications.
The equipment image is recognized through the trained equipment recognition model, and the preset security check configuration information is used to extract and classify features to automatically determine whether the equipment image complies with security check specifications.
It realizes automatic processing of security inspection of liquefied gas equipment, improves security inspection efficiency, reduces the need for manual review, and ensures the consistency and accuracy of testing standards.
Smart Images

Figure CN120580693A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of security inspection, and in particular to an image processing method, device, computer equipment and storage medium. Background Art
[0002] In today's society, bottled liquefied gas (LPG) remains a popular commodity. When delivered to users' homes, it requires on-site inspection to check for potential safety hazards. Traditionally, LPG delivery personnel or users take images of the bottled LPG equipment, upload them to a security inspection platform, and manually review them to ensure they meet photography specifications. However, manual review is labor-intensive and inefficient, requiring significant effort. Therefore, developing an image processing method that improves security inspection efficiency has become a pressing issue. Summary of the Invention
[0003] Based on this, it is necessary to provide an image processing method, device, computer equipment and storage medium to address the above technical problems, so as to solve the problem of low security inspection efficiency of traditional methods.
[0004] Obtaining an image of a device to be inspected and a trained device recognition model, wherein the device image includes at least one liquefied gas device, and the trained device recognition model is trained based on preset security inspection configuration information; Performing recognition processing on the device image based on the trained device recognition model to obtain a recognition result of at least one of the liquefied gas devices in the device image; Based on the recognition result of the liquefied gas equipment, it is determined whether the image of the equipment to be inspected meets the security inspection shooting specification.
[0005] Optionally, before acquiring the trained device recognition model, the method further includes: Obtain the device recognition model to be trained and sample device images; Based on the preset security inspection configuration information, the sample device image is labeled to obtain an image label of the sample device image; Constructing a training set based on the sample device images and the corresponding image labels; The device recognition model to be trained is trained based on the training set to obtain the trained device recognition model.
[0006] Optionally, the labeling process of the sample device image based on the preset security inspection configuration information to obtain the image label of the sample device image includes: Determining a target device, a device category, and image coordinates of the target device in each of the sample device images based on the preset security inspection configuration information; An image label of the sample device image is determined based on the device category and image coordinates of each target device in the sample device image.
[0007] Optionally, the training the device recognition model to be trained based on the training set to obtain the trained device recognition model includes: Providing the training set to the device recognition model to be trained for recognition processing to obtain a recognition result of the training set; Calculating a loss value of the recognition result based on a preset loss function; With minimizing the loss value as the optimization goal, the parameters of the device identification model to be trained are adjusted through the back propagation algorithm, and the parameter adjustment process is iterated until the loss value converges to the minimum or the number of iterations reaches a preset value, and the training is stopped to obtain the trained device identification model.
[0008] Optionally, the parameters of the device recognition model to be trained include basic parameters and enhanced parameters, the basic parameters are used to adjust the learning strategy of the training process, and the enhanced parameters are used to adjust the image parameters of the sample device images in the training set.
[0009] Optionally, the recognition result includes a device category and a recognition confidence level, and determining whether the image of the device to be inspected meets security inspection photography specifications based on the recognition result of the liquefied gas device includes: Comparing the identification confidence of the liquefied gas equipment of each equipment category with a preset confidence threshold to obtain a comparison result of the liquefied gas equipment of each equipment category; Based on the comparison results of the liquefied gas equipment of each equipment category, it is determined whether the image of the equipment to be inspected meets the security inspection shooting specifications.
[0010] Optionally, the determining whether the image of the device to be inspected meets security inspection photography specifications based on the comparison results of the liquefied gas devices of each device category includes: If the comparison results of the liquefied gas equipment of all equipment categories are that the recognition confidence is greater than the preset confidence threshold, it is determined that the image of the equipment to be inspected meets the security inspection shooting specification; If the recognition confidence of the liquefied gas equipment of any equipment category is not greater than the preset confidence threshold, it is determined that the image of the equipment to be inspected does not meet the security inspection shooting specification.
[0011] An image processing device, comprising: An acquisition module, configured to acquire an image of a device to be inspected and a trained device recognition model, wherein the image of the device includes at least one liquefied gas device, and the trained device recognition model is trained based on preset security inspection configuration information; an identification module, configured to perform identification processing on the device image based on a trained device identification model, and obtain an identification result of at least one of the liquefied gas devices in the device image; The determination module is used to determine whether the image of the equipment to be inspected meets the security inspection shooting specifications based on the recognition result of the liquefied gas equipment.
[0012] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the image processing method is implemented.
[0013] A readable storage medium stores computer-readable instructions, which implement the above-mentioned image processing method when executed by a processor.
[0014] The above-mentioned image processing method, apparatus, computer equipment, and storage medium obtain an image of a device to be inspected and a trained device recognition model, wherein the device image includes at least one liquefied gas device, and the trained device recognition model is trained based on preset security inspection configuration information; the device image is recognized and processed based on the trained device recognition model to obtain an identification result of at least one liquefied gas device in the device image; and based on the identification result of the liquefied gas device, it is determined whether the image of the device to be inspected meets the security inspection photography specifications. By recognizing and processing the device image using the trained device recognition model, an identification result of at least one liquefied gas device can be efficiently obtained. Since the trained device recognition model is obtained based on preset security inspection configuration information, it is possible to efficiently obtain the identification result while accurately determining whether the image of the device to be inspected meets the security inspection photography specifications based on the identification result. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0016] Figure 1 is a flow chart of an image processing method according to an embodiment of the present invention; Figure 2 This is a schematic diagram showing the effect of the recognition result of the liquefied gas equipment in one embodiment of the present invention; Figure 3 is a structural diagram of an image processing device according to an embodiment of the present invention; Figure 4 FIG. 1 is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0017] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0018] In one embodiment, if Figure 1 As shown, an image processing method is provided, comprising the following steps: 101. Obtain images of the device to be inspected and a trained device recognition model.
[0019] In an embodiment of the present invention, the above-mentioned image processing method can also be applied to a security inspection platform. The above-mentioned security inspection platform can be constructed by a server or a server cluster. The above-mentioned server or server cluster can be any electronic device with functions such as image recognition, image processing, image analysis, data storage, and data transmission.
[0020] The device image includes at least one liquefied gas device, which may be a cylinder pressure reducing valve, a gas leak alarm, a gas cooker, a gas water heater, a pipeline, a gas cylinder, a shut-off valve or other liquefied gas device.
[0021] The trained device recognition model can be trained based on preset security configuration information. Specifically, the security configuration information can be configured based on security requirements and specifically defines a list of objects to be detected and their corresponding categories. The trained device recognition model can be trained using any deep learning model using the preset security configuration information.
[0022] When liquefied gas cylinders are delivered to users, policy requirements require on-site safety inspections. This involves checking for potential safety hazards associated with gas usage in the user's home (i.e., inspecting liquefied gas equipment). The images of the equipment to be inspected can be captured by the delivery personnel using any smart device upon delivery of the liquefied gas cylinders to the user and uploaded to the aforementioned security inspection platform.
[0023] 102. Perform recognition processing on the device image based on the trained device recognition model to obtain a recognition result of at least one liquefied gas device in the device image.
[0024] In an embodiment of the present invention, the device image may be input into the trained device recognition model to obtain a recognition result of at least one liquefied gas device in the device image. The recognition result may include a device category and a recognition confidence level.
[0025] The aforementioned recognition process refers to the process of extracting features and classifying the input image. Specifically, spatial feature extraction can be achieved through multi-layer convolution kernel operations, and the classifier can be used to output device category and location information. Alternatively, the trained device recognition model can be a trained YOLO11n model. The device image is provided to the trained YOLO11n model, and the output of the trained YOLO11n model (i.e., the device category and image coordinates) is used as the recognition result for the liquefied gas device.
[0026] Specifically, the identification result of the above liquefied gas equipment can be obtained by Figure 2 The schematic diagram of the recognition result of a liquefied gas device shown further illustrates that Figure 2 The image includes six images of devices to be inspected, each of which includes at least one identification box. The identification box can be generated according to the image coordinates. The upper left corner of each identification box includes a device category (for example, the numbers 0, 3, 5), etc. Different numbers correspond to different device categories.
[0027] 103. Based on the recognition result of the liquefied gas equipment, determine whether the image of the equipment to be inspected meets the security inspection shooting specifications.
[0028] In an embodiment of the present invention, traditional image processing methods often require manual review of whether the image of the device to be inspected meets the photography specifications after it is uploaded. This review work requires a lot of manual intervention. However, through the recognition results of the liquefied gas equipment, it can be accurately determined whether the image of the device to be inspected meets the security inspection photography specifications, thereby reducing the work of manual review of whether the image of the device to be inspected meets the security inspection photography specifications, thereby preventing delivery personnel or users from not taking the image of the device to be inspected in accordance with the specifications.
[0029] The security inspection photography specification can be specifically understood as whether the liquefied gas equipment is fully photographed, or whether the image of the equipment to be inspected contains all the equipment corresponding to the configuration items required by the preset security inspection configuration information. Each configuration item corresponds to one equipment.
[0030] Compared with existing technologies, traditional methods rely entirely on manual experience to determine image compliance, which is subject to subjective bias and efficiency bottlenecks. This solution automates device detection by training a recognition model with specific security configurations. The model can quickly analyze image features, eliminating the inefficient process of manual, piecemeal inspections. Furthermore, recognition standards established based on unified security configuration information eliminate discrepancies between auditors and improve the consistency of audit results. Furthermore, if the security configuration changes, the trained device recognition model can be promptly updated based on the updated information.
[0031] Through the above technical solution, this application achieves automated processing for liquefied gas equipment safety inspections. Machine learning-based image recognition technology significantly shortens review time and effectively reduces reliance on human resources. By training the model with pre-set security inspection configuration information, it ensures that inspection standards are highly consistent with safety regulations, avoiding misjudgments and missed inspections caused by human factors. This method can process equipment image data in real time, promptly identifying potential safety hazards and providing reliable technical support for the safety management of liquefied gas equipment.
[0032] In an embodiment of the present invention, an image of a device to be inspected and a trained device recognition model are obtained, wherein the device image includes at least one liquefied gas device, and the trained device recognition model is trained based on preset security inspection configuration information; the device image is subjected to recognition processing based on the trained device recognition model to obtain an identification result of at least one liquefied gas device in the device image; and based on the identification result of the liquefied gas device, it is determined whether the image of the device to be inspected meets security inspection photography specifications. By using the trained device recognition model to recognize and process the device image, an identification result of at least one liquefied gas device can be efficiently obtained. Since the trained device recognition model is obtained based on preset security inspection configuration information, it is possible to efficiently obtain the identification result while accurately determining whether the image of the device to be inspected meets security inspection photography specifications based on the identification result.
[0033] It is understandable that in the specific implementation of this application, related data such as the image of the device to be inspected, preset security inspection configuration information, sample device images, etc., when the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data and the construction, training and use of the device recognition model need to comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0034] Optionally, before the step of obtaining a trained device recognition model, the device recognition model to be trained and the sample device image can also be obtained; based on the preset security configuration information, the sample device image is labeled to obtain the image label of the sample device image; based on the sample device image and the corresponding image label, a training set is constructed; based on the training set, the device recognition model to be trained is trained to obtain a trained device recognition model.
[0035] In an embodiment of the present invention, the device recognition model to be trained refers to an untrained neural network model (such as yolov11n) with initial parameters, which can be implemented using a convolutional neural network architecture to extract features from sample device images and output recognition results.
[0036] Among them, sample equipment images refer to a collection of images that contain liquefied gas equipment and have diverse scene features. This can be achieved by collecting photos of liquefied gas equipment in different environments to provide a data basis for model training.
[0037] Image labels refer to structured data that annotates the category and location information of liquefied gas equipment in sample equipment images. This can be achieved by using target detection and annotation tools to select and classify the equipment in the image, which is used to guide the model to learn equipment features.
[0038] The training set refers to a data set consisting of sample device images and their corresponding image labels. This can be achieved by randomly dividing the sample data and maintaining the correspondence between images and labels, and is used to drive the model parameter optimization process.
[0039] Specifically, the device recognition model to be trained is first initialized as a convolutional neural network with a basic network structure. Sample device images are labeled using pre-set security configuration information, and the location coordinates and device category of each liquefied gas device in the image are annotated using annotation tools, forming image labels containing bounding box coordinates and classification information. The annotated sample device images and corresponding image labels are divided into training and validation sets according to a pre-set ratio. During training, sample images from the training set are input into the device recognition model. The model's predicted results are compared with the actual annotations in the image labels. Model parameters are adjusted using a backpropagation algorithm, and optimization is iteratively optimized until the model reaches the pre-set convergence criteria.
[0040] Compared to existing technologies, traditional methods rely on manual image annotation and review, which is time-consuming and subject to subjective errors. This solution, however, automatically generates image labels based on pre-set security inspection configuration information. Combined with a batch model training process, this effectively reduces manual intervention, improves annotation efficiency, and enhances model training consistency.
[0041] Through the above technical solution, this application realizes the automated training process of the device recognition model, solves the problem of model update lag caused by the low efficiency of traditional manual labeling, and provides reliable model support for the rapid and accurate recognition of subsequent device images.
[0042] Optionally, in the step of annotating the sample device image based on the preset security configuration information to obtain the image label of the sample device image, the target device and the device category and image coordinates of the target device can also be determined in each sample device image based on the preset security configuration information; and the image label of the sample device image can be determined based on the device category and image coordinates of each target device in the sample device image.
[0043] In an embodiment of the present invention, the above-mentioned preset security configuration information may include at least one configuration item, and the above-mentioned configuration item may be a category label 1 (i.e., valve, cylinder pressure reducing valve), 3 (i.e., leak_alarm, gas leak alarm), 4 (i.e., stove, gas stove), 5 (i.e., heater, gas water heater), 6 (i.e., pipeline), 7 (i.e., cylinder, gas cylinder), 8 (i.e., shut_off_valve, shut-off valve) or 9 (i.e., rectification_notice, rectification notice), etc.
[0044] The target device refers to the liquefied gas equipment that needs to be identified in the sample image. The specific liquefied gas equipment that needs to be identified in the sample image depends on the configuration items in the above-mentioned preset security configuration information. Specifically, identification can be achieved through target detection algorithms such as YOLO or Faster R-CNN, which is used to accurately locate the device area from a complex background. The equipment category refers to the classification identification of liquefied gas equipment, such as cylinder pressure reducing valves, gas leak alarms or gas stoves. Specifically, it can be achieved through classification models or rule matching algorithms to solve the category misjudgment problem that may exist in manual labeling in traditional methods. Image coordinates refer to the location information of the target device in the image. Specifically, it can be annotated in the form of bounding box coordinates or key point coordinates, for example, generated by image processing functions in the OpenCV library. Its function is to provide a spatial positioning basis for model training.
[0045] Specifically, during the sample device image annotation process, a pre-trained detection model, combined with the configuration items in the security inspection configuration information, scans the image and identifies all target devices. Next, the target objects in the detection results are matched to pre-set categories according to the device category mapping table defined in the configuration information, generating corresponding classification labels. Simultaneously, the coordinate extraction module records the vertex coordinates or center point coordinates of the target device's bounding box. Finally, the device category and image coordinates are combined to form structured label data, which serves as the image label for the sample device. For example, if a cylinder pressure relief valve is detected in the image, its category label is "1," and the coordinate labels are the midpoint horizontal coordinate, center point vertical coordinate, box width, and box height of the identification box. It should be noted that the aforementioned device category mapping table includes correspondences between category labels and device categories, such as the correspondence between category label 1 and the device category cylinder pressure relief valve, the correspondence between category label 3 and the gas leak alarm, and the correspondence between category label 4 and the gas stove.
[0046] The format of the above image labels can be a .txt file, with each line formatted as <category number><x_center><y_center> <width> <height>, where the category number (i.e. the category label mentioned above) is<x_center> is the horizontal coordinate of the midpoint of the above identification box,<y_center> is the vertical coordinate of the center point of the above identification box, <width>is the recognition box width, <height>The height of the recognition frame.
[0047] Compared with existing technologies, traditional methods often rely on manual labeling of device categories and locations, which results in low labeling efficiency and inconsistent standards. This solution, however, automates the labeling process, combining preset rules with algorithms to generate standardized label data in batches, significantly reducing manual intervention and improving labeling speed and consistency.
[0048] Through the above technical solution, this application solves the problems of low efficiency and easy errors in the traditional sample labeling process, realizes the rapid and accurate labeling of device categories and spatial location information, and provides a high-quality data foundation for subsequent model training, thereby improving the accuracy of the device recognition model and the reliability of the security inspection process.
[0049] Optionally, in the step of training the device recognition model to be trained based on the training set to obtain a trained device recognition model, the training set can also be provided to the device recognition model to be trained for recognition processing to obtain a recognition result of the training set; the loss value of the recognition result is calculated based on a preset loss function; with minimizing the loss value as the optimization goal, the parameters of the device recognition model to be trained are adjusted through the back propagation algorithm, and the parameter adjustment process is iterated until the loss value converges to the minimum, or the number of iterations reaches a preset value, the training is stopped, and a trained device recognition model is obtained.
[0050] In an embodiment of the present invention, a training set refers to a data set used for model training. Specifically, it can be constructed using sample device images labeled with device categories and coordinate information. By matching sample images with labels, the model learns the mapping relationship between features and targets. A loss function refers to a mathematical function that measures the difference between the model's prediction results and the true labels. Specifically, it can be implemented using a cross-entropy loss or a mean square error function, which guides the optimization of model parameters by quantifying the prediction error. The backpropagation algorithm refers to a calculation method for adjusting the weights of a neural network based on the principle of gradient descent. Specifically, the contribution of each parameter to the loss value can be calculated layer by layer through the chain rule, thereby updating the parameters to reduce the error. Parameter adjustment refers to the process of iteratively optimizing the internal weights of the model. Specifically, the optimization speed and stability can be controlled by adjusting hyperparameters such as the learning rate and momentum factor, so that the model gradually approaches the optimal solution.
[0051] Specifically, after the training set is input into the device recognition model, the model extracts features and predicts the category of the sample device images, outputting the recognition results. A loss function compares the predicted results with the true labels, generating a loss value that reflects the current model error level. The backpropagation algorithm calculates the gradient information of each layer's parameters based on the loss value and iteratively updates the weights. During training, parameter adjustments continue until the loss value stabilizes or the preset number of iterations is reached, indicating that the model has sufficient recognition accuracy and generalization capabilities.
[0052] It should be noted that the parameters of the device recognition model to be trained include basic parameters and enhanced parameters. The basic parameters are used to adjust the learning strategy of the training process, and the enhanced parameters are used to adjust the image parameters of the sample device images in the training set.
[0053] Basic parameters refer to the parameters that control the learning behavior during model training. Specifically, they include Epochs = 100 (the total number of training epochs), imgsz = 720 (the target image size), optimizer = AdamW (the optimizer), multi_scale = True (increasing / decreasing the imgsz coefficient), cos_lr = True (using the cosine learning rate scheduler), and lr0 = 0.0005 (the initial learning rate). By adjusting basic parameters, the model convergence speed and training stability can be optimized.
[0054] Among them, the enhancement parameters refer to the parameters used to perform data enhancement processing on the training images, which can specifically include hsv_h (i.e., dynamically changing lighting conditions), hsv_s (i.e., dynamically changing the image saturation), hsv_v (i.e., dynamically changing the image value (brightness)), degrees (i.e., dynamically rotating the image randomly), translate (i.e., dynamic horizontal and vertical translation), scale (i.e., dynamically scaling the image), shear (i.e., shearing the image at a specified angle), perspective (i.e., random perspective transformation), and flipud (i.e., probabilistically flipping the image). By enhancing the parameters, the diversity of the training data can be improved and the robustness of the model to image changes can be enhanced.
[0055] Specifically, during model training, basic parameters are configured to optimize learning strategies. For example, this involves dynamically adjusting the learning rate to avoid falling into local optimal solutions, while also balancing computational efficiency and model accuracy through the selection of optimizer types. Enhancement parameters are applied to the preprocessing of sample device images. For example, brightness parameters can be adjusted to simulate device images under different lighting conditions, or rotation parameters can be used to generate image variants at different angles, thereby expanding the coverage of the training set. These multiple enhancement parameters work together to enable the model to efficiently learn features during training while also adapting to image variations in real-world scenarios.
[0056] Optionally, in the step of determining whether the image of the device to be inspected meets the security inspection shooting specifications based on the recognition result of the liquefied gas equipment, a comparison process can be performed based on the recognition confidence of the liquefied gas equipment of each equipment category and a preset confidence threshold to obtain the comparison result of the liquefied gas equipment of each equipment category; based on the comparison result of the liquefied gas equipment of each equipment category, it is determined whether the image of the device to be inspected meets the security inspection shooting specifications.
[0057] In an embodiment of the present invention, the above-mentioned recognition results include device categories and recognition confidence. The device category refers to the judgment result of the device recognition model on the category to which the liquefied gas device in the image belongs. Specifically, this can be achieved by extracting image features through a convolutional neural network and outputting classification labels. This feature is used to distinguish different types of liquefied gas equipment. The recognition confidence refers to the model's probabilistic confidence level in the recognition result. Specifically, this can be achieved by converting the output of the device recognition model into a probability value through a softmax function. This value reflects the reliability of the recognition result. The preset confidence threshold refers to a pre-set judgment standard. Specifically, it can be determined through experimental testing or empirical values. For example, it is set to 0.9 and is used to screen recognition results that meet the confidence level.
[0058] Specifically, after processing the device image, the device recognition model outputs the corresponding device category and its recognition confidence score for each liquefied gas device. The confidence score for each device category is then compared against a pre-set threshold. Once all devices in each category pass the threshold verification, the device image is deemed to meet security inspection photography standards. If any category fails to meet the standard, the image is deemed to fail security inspection photography standards.
[0059] In one possible embodiment, each device category may correspond to a preset confidence threshold. The preset confidence thresholds for different device categories may be the same or different, depending on the device category. For example, when the device category is a general-purpose device, its identification is clear and the error rate is low (i.e., the identification difficulty is low), then the corresponding confidence threshold can be set higher accordingly; conversely, when the device category is a device with a complex form and easy to confuse (i.e., the identification difficulty is high), then the corresponding confidence threshold can be set lower accordingly. Alternatively, for device categories involving high security risks (e.g., alarms, pressure regulating valves, etc.), the above confidence threshold can be set higher accordingly, and for device categories involving low security risks (e.g., wall brackets), the above confidence threshold can be set lower accordingly.
[0060] Specifically, the above confidence threshold can also be calculated by the following formula:
[0061] in, is represented as the confidence threshold of the i-th device category, Expressed as the minimum confidence threshold, It is expressed as the maximum confidence threshold, and the numerical range between the minimum confidence threshold and the maximum confidence threshold is the value range of the confidence threshold. It is expressed as a weighting factor with a value range of [0,1], which is used to adjust the impact ratio of "identification difficulty" and "security risk". It is expressed as the recognition difficulty weight of the i-th device category. The larger the value, the more difficult it is to recognize. It is represented as the safety risk weight of the i-th equipment category. The larger the value, the higher the safety risk. If a certain equipment category is easy to identify, such as cylinders, then Should be low. If the safety risk of a certain type of equipment is high, such as gas leak alarm, then Should be higher.
[0062] Optionally, in the step of determining whether the image of the device to be inspected meets the security inspection shooting specifications based on the comparison results of the liquefied gas equipment of each device category, if the comparison results of the liquefied gas equipment of all device categories are that the recognition confidence is greater than a preset confidence threshold, then it is determined that the image of the device to be inspected meets the security inspection shooting specifications; if the recognition confidence of the liquefied gas equipment of any device category is not greater than the preset confidence threshold, then it is determined that the image of the device to be inspected does not meet the security inspection shooting specifications.
[0063] In an embodiment of the present invention, when the above-mentioned preset confidence threshold is only a fixed value, for example, 0.9, the recognition confidence of each device category can be compared with 0.9. If the comparison results of the liquefied gas equipment of all device categories are that the recognition confidence is greater than the preset confidence threshold, it is determined that the image of the device to be inspected meets the security inspection shooting specifications; if the recognition confidence of the liquefied gas equipment of any device category is not greater than the preset confidence threshold, it is determined that the image of the device to be inspected does not meet the security inspection shooting specifications.
[0064] In a possible embodiment, if each device category corresponds to a preset confidence threshold, that is, if there are multiple preset confidence thresholds, the recognition confidence of each device category can be compared with the corresponding confidence threshold to obtain a comparison result for each device category. If the comparison results of the liquefied gas equipment of all device categories are that the recognition confidence is greater than the corresponding preset confidence threshold, it is determined that the image of the device to be inspected meets the security inspection shooting specifications; if the recognition confidence of the liquefied gas equipment of any device category is not greater than the corresponding preset confidence threshold, it is determined that the image of the device to be inspected does not meet the security inspection shooting specifications.
[0065] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0066] In one embodiment, an image processing device is provided, which corresponds one-to-one to the image processing method in the above embodiment. Figure 3 As shown, the image processing device includes an acquisition module 301, a recognition module 302 and a determination module 303. The functional modules are described in detail as follows: An acquisition module 301 is configured to acquire an image of a device to be inspected and a trained device recognition model, wherein the image includes at least one liquefied gas device and the trained device recognition model is trained based on preset security inspection configuration information. An identification module 302 is configured to perform identification processing on the device image based on a trained device identification model to obtain an identification result of at least one liquefied gas device in the device image; The determination module 303 is configured to determine whether the image of the device to be inspected meets security inspection photography specifications based on the recognition result of the liquefied gas device.
[0067] Optionally, the image processing device further includes: A second acquisition module is used to acquire a device recognition model to be trained and a sample device image; A first labeling module is configured to label the sample device image based on the preset security inspection configuration information to obtain an image label of the sample device image; A first construction module is configured to construct a training set based on the sample device images and the corresponding image labels; The first training module is used to train the device recognition model to be trained based on the training set to obtain the trained device recognition model.
[0068] Optionally, the first labeling module includes: A first determination submodule is configured to determine a target device, a device category, and image coordinates of the target device in each of the sample device images based on the preset security inspection configuration information; The second determining submodule is configured to determine an image label of the sample device image based on the device category and image coordinates of each target device in the sample device image.
[0069] Optionally, the first training module includes: A first recognition submodule is configured to provide the training set to the device recognition model to be trained for recognition processing to obtain a recognition result of the training set; A first calculation submodule, configured to calculate a loss value of the recognition result based on a preset loss function; The first training submodule is used to adjust the parameters of the device identification model to be trained through the back propagation algorithm with the minimization of the loss value as the optimization goal, iterate the parameter adjustment process until the loss value converges to the minimum or the number of iterations reaches a preset value, stop training, and obtain the trained device identification model.
[0070] Optionally, the parameters of the device recognition model to be trained include basic parameters and enhanced parameters, the basic parameters are used to adjust the learning strategy of the training process, and the enhanced parameters are used to adjust the image parameters of the sample device images in the training set.
[0071] Optionally, the determining module 303 includes: A first comparison submodule is configured to perform a comparison process based on the identification confidence of the liquefied gas equipment of each equipment category and a preset confidence threshold, thereby obtaining a comparison result of the liquefied gas equipment of each equipment category; The third determination submodule is configured to determine whether the image of the device to be inspected meets the security inspection photography specification based on the comparison result of the liquefied gas equipment of each equipment category.
[0072] Optionally, the third determining submodule includes: a first determining unit, configured to determine that the image of the device to be inspected meets the security inspection photography specification if the comparison results of the liquefied gas devices of all device categories all have the recognition confidence greater than the preset confidence threshold; The second determining unit is configured to determine that the image of the device to be inspected does not meet the security inspection shooting specification if the recognition confidence of the liquefied gas device of any device category is not greater than the preset confidence threshold.
[0073] Each module in the above-mentioned image processing device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0074] In one embodiment, a computer device is provided. The computer device may be a terminal device, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer-readable instructions. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer-readable instructions are executed by the processor, an image processing method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0075] In an embodiment of the present application, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the steps of the above-mentioned image processing method are implemented.
[0076] In an embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the steps of the above-mentioned image processing method are implemented.
[0077] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions. The computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0078] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0079] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.< / height> < / width> < / height> < / width>
Claims
1. An image processing method, characterized in that: The method comprises: Obtaining an image of a device to be inspected and a trained device recognition model, wherein the device image includes at least one liquefied gas device, and the trained device recognition model is trained based on preset security inspection configuration information; Performing recognition processing on the device image based on the trained device recognition model to obtain a recognition result of at least one of the liquefied gas devices in the device image; Based on the recognition result of the liquefied gas equipment, it is determined whether the image of the equipment to be inspected meets the security inspection shooting specification.
2. The image processing method according to claim 1, wherein: Before obtaining the trained device recognition model, the method further includes: Obtain the device recognition model to be trained and sample device images; Based on the preset security inspection configuration information, the sample device image is labeled to obtain an image label of the sample device image; Constructing a training set based on the sample device images and the corresponding image labels; The device recognition model to be trained is trained based on the training set to obtain the trained device recognition model.
3. The image processing method according to claim 2, wherein: The tagging process of the sample device image based on the preset security inspection configuration information to obtain the image label of the sample device image includes: Based on the preset security inspection configuration information, determining a target device and a device category and image coordinates of the target device in each of the sample device images; An image label of the sample device image is determined based on the device category and image coordinates of each target device in the sample device image.
4. The image processing method according to claim 2, wherein: The training process of the device recognition model to be trained based on the training set to obtain the trained device recognition model includes: Providing the training set to the device recognition model to be trained for recognition processing to obtain a recognition result of the training set; Calculating a loss value of the recognition result based on a preset loss function; With minimizing the loss value as the optimization goal, the parameters of the device identification model to be trained are adjusted through the back propagation algorithm, and the parameter adjustment process is iterated until the loss value converges to the minimum or the number of iterations reaches a preset value, and the training is stopped to obtain the trained device identification model.
5. The image processing method according to claim 4, wherein: The parameters of the device recognition model to be trained include basic parameters and enhanced parameters. The basic parameters are used to adjust the learning strategy of the training process, and the enhanced parameters are used to adjust the image parameters of the sample device images in the training set.
6. The image processing method according to claim 1, wherein: The recognition result includes a device category and a recognition confidence level. The determining, based on the recognition result of the liquefied gas device, whether the image of the device to be inspected meets security inspection photography specifications includes: Comparing the identification confidence of the liquefied gas equipment of each equipment category with a preset confidence threshold to obtain a comparison result of the liquefied gas equipment of each equipment category; Based on the comparison results of the liquefied gas equipment of each equipment category, it is determined whether the image of the equipment to be inspected meets the security inspection shooting specifications.
7. The image processing method according to claim 6, wherein: The determining whether the image of the device to be inspected meets the security inspection photography specification based on the comparison result of the liquefied gas equipment of each equipment category includes: If the comparison results of the liquefied gas equipment of all equipment categories are that the recognition confidence is greater than the preset confidence threshold, it is determined that the image of the equipment to be inspected meets the security inspection shooting specification; If the recognition confidence of the liquefied gas equipment of any equipment category is not greater than the preset confidence threshold, it is determined that the image of the equipment to be inspected does not meet the security inspection shooting specification.
8. An image processing device, characterized in that: include: An acquisition module, configured to acquire an image of a device to be inspected and a trained device recognition model, wherein the image of the device includes at least one liquefied gas device, and the trained device recognition model is trained based on preset security inspection configuration information; an identification module, configured to perform identification processing on the device image based on a trained device identification model, and obtain an identification result of at least one liquefied gas device in the device image; The determination module is used to determine whether the image of the equipment to be inspected meets the security inspection shooting specifications based on the recognition result of the liquefied gas equipment.
9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executed on the processor, wherein: When the processor executes the computer-readable instructions, the image processing method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having computer-readable instructions stored thereon, characterized in that: When the computer-readable instructions are executed by a processor, the image processing method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Image acquisition method and device, equipment and computer readable storage medium
CN111783775A
Image type identification method and device, equipment, medium and product
CN114708539A
Target re-identification method, electronic equipment and storage medium
CN116109846A
Power transmission line unmanned aerial vehicle automatic inspection system based on Beidou navigation and artificial intelligence
CN118838376A
X-ray security check image dangerous goods detection system based on improved YOLOv11
CN119624939A