Methods and systems for analyzing and modifying deep learning algorithms to reduce their resource consumption
By extracting features and using surrogate models to optimize deep learning algorithms, the method addresses inefficiencies in existing systems, reducing environmental impact while maintaining performance, with a focus on model-specific optimizations and region-aware calculations.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- NEXADEEDS INC
- Filing Date
- 2025-11-21
- Publication Date
- 2026-05-28
AI Technical Summary
Existing methods for optimizing deep learning algorithms focus on global energy consumption and carbon footprint, neglecting model-specific optimizations, leading to inefficiencies and performance reductions, and lack detailed insights into water footprint, especially in water-scarce regions.
A method that extracts features from deep learning algorithms and datasets, using surrogate models to predict resource footprint and performance, enabling multi-objective optimization to reduce environmental impact while maintaining efficiency and performance, incorporating region-specific data for precise calculations.
Enables developers to make informed adjustments to deep learning algorithms, reducing carbon and water footprints with minimal accuracy loss, avoiding costly training runs and providing granular environmental impact assessments.
Smart Images

Figure CA2025051573_28052026_PF_FP_ABST
Abstract
Description
METHODS AND SYSTEMS FOR ANALYZING AND MODIFYINGDEEP LEARNING ALGORITHMS TO REDUCE THEIR RESOURCE CONSUMPTIONCROSS-REFERENCE TO PREVIOUS APPLICATON
[0001] This application claims priority from United States provisional patent application 63 / 723,803 filed on 22 November 2024 which is incorporated herein by reference in its entirety.FIELD
[0002] The present disclosure generally relates to the field of artificial intelligence (Al). In particular, various embodiments are described herein that relate to methods and systems for analyzing and modifying deep learning algorithms.INTRODUCTION
[0003] The following paragraphs are provided by way of background to the present disclosure. They are not, however, an admission that anything discussed therein is prior art or part of the knowledge of persons skilled in the art.
[0004] The recent rise of artificial intelligence as a commercially viable technology has led to an explosion of use cases and use of deep learning models. The development and use of complex deep learning models is a resource-intensive process. Training deep learning models with large neural networks, requires vast computational power, which in turn demands a substantial amount of electricity and water. This electricity may predominantly originate from non-renewable sources, particularly in regions where the energy grid remains heavily dependent on fossil fuels. The training process involves running numerous high-performance Graphical Processing Units (GPUs) or Tensor Processing Units (TPUs) for extended periods, consuming a significant amount of power.
[0005] In addition to training, the deployment and continuous use of deep learning models in real-world applications contribute to ongoing energy consumption. Large-scale Al systems, such as those used for cloud-based services, recommendation algorithms, and language models, need to process vast amounts of data in real-time, further increasing their energy demand.
[0006] Deep learning models are now essential in many fields, from healthcare to finance. As businesses increasingly rely on Al to solve problems, the total environmental impact of these technologies could become significant. While there are efforts to make deep learning models more energy-efficient, their rapid expansion and computational requirements continue to make their carbon footprint and / or water footprint a significant concern.
[0007] Furthermore, existing methods such as CodeCarbon™, Eco2AI™, and Carbontracker™ focus on assessing the overall energy consumption of the entire machine during deep learning processes, or on approaches to reducing the carbon footprint of training and running deep learning models, such as hardware optimization, clean cloud solutions, and similar strategies. These methods primarily calculate energy consumption for the whole system, however, which may not provide detailed insights into optimizing energy usage specifically for the deep learning code itself.
[0008] Simultaneously, a less recognized impact is the water footprint of Al. Water is extensively used in electricity generation (e.g., cooling thermal power plants) and in data center cooling systems (especially evaporative cooling). This dependency becomes more problematic in water-scarce regions, where sustainability efforts must consider local water availability. Training a single Al model can generate carbon emissions comparable to five gasoline-powered cars. Likewise, it may indirectly consume hundreds of liters of water depending on regional electricity sources. These environmental effects are amplified as Al becomes foundational in fields such as healthcare, finance, logistics, and defense.
[0009] Moreover, these methods can result in reduced efficiency (e.g., slower model speed) and performance (e.g., lower model accuracy), as they emphasize global energy metrics rather than model-specific optimizations.
[0010] There is therefore a clear need for methods and systems for analyzing and modifying deep learning algorithms that address the challenges and / or shortcomings described above.SUMMARY
[0011] Various embodiments of methods and systems for modifying deep learning algorithms by providing developers with insights on the potential impacts of their deep learning algorithms on the environment, as well as recommendations for reducing the resource footprint of their deep learning algorithms while maintaining the efficiency and performance of their deep learning algorithms, are provided according to the teachings herein.
[0012] According to an aspect of the present disclosure, there is provided a method of modifying parameters of a deep learning algorithm. The method comprises extracting features from code and one or more datasets relating to the deep learning algorithm. The method also comprises feeding the extracted features into a first surrogate machine learning model and one or more second surrogate machine learning models, wherein the first surrogate machine learning model outputs information relating to a prediction of the resource footprint of executing the deep learning algorithm and the one or more second surrogate machine learning models output information relating to a prediction of the efficiency and performance of the deep learning algorithm. The method also comprises estimating the resource footprint of executing the deep learning algorithm based at least in part on the information relating to the prediction of the resource footprint and estimating the efficiency and performance of executing the deep learning algorithm based at least in part on the information relating to the prediction of the efficiency and performance. The method also comprises determining, based on the estimate of the resource footprint and the estimate of the estimate of the efficiency and performance, at least one recommendation to modify one or more parameters of the deep learning algorithm to reduce the resource footprint of the deep leaning algorithm while increasing or maintaining the efficiency and performance of the deep learning algorithm.
[0013] In some examples, the method further comprises determining geographic location information of a computing resource used to execute the deep learning algorithm and determining resource intensity information relating to the resource intensity of executing the deep learning algorithm based in part on the geographic location information, and using the resource intensity, wherein the step of estimating the resourcefootprint of executing the deep learning algorithm is also based on the resource intensity information.
[0014] In some examples, determining at least one recommendation includes multi-objective optimization which minimizes energy consumption while ensuring performance metrics remain above a certain threshold.
[0015] In some examples, the method further comprises setting weights in the multi-objective optimization relating to how much emphasis is placed on reducing resource footprint versus ensuring performance.
[0016] In some examples, each of the one or more second surrogate machine learning models is trained to predict a different performance metric from within a plurality of performance metrics.
[0017] In some examples, the plurality of performance metrics including one or more of recall, F1-score, Mean Absolute Error, Mean Squared Error, Root Mean Squared Error, and R-squared.
[0018] In some examples, extracting features from code and one or more datasets relating to the deep learning algorithm includes extracting features from the code using a rule-based feature extraction method.
[0019] In some examples, extracting features from code and one or more datasets relating to the deep learning algorithm includes extracting features from the code using a natural language processing feature extraction method.
[0020] In some examples, extracting features from code and one or more datasets relating to the deep learning algorithm includes extracting features from the dataset using baseline machine learning algorithm feature extraction.
[0021] In some examples, extracting features from the dataset using baseline machine learning algorithm feature extraction includes separating the dataset into a training dataset and a testing dataset. Extracting features from the dataset using baseline machine learning algorithm feature extraction also includes determining the target variable of the deep learning model and the nature of the deep learning model and selecting one or more baseline machine learning models based on the nature of the deeplearning model. Extracting features from the dataset using baseline machine learning algorithm feature extraction also includes training the one or more baseline machine learning models using the training dataset, evaluating the performance of the one or more baseline machine learning models using the testing data set using one or more performance metrics and using the evaluation results as features of the dataset.
[0022] In some examples, extracting features from code and one or more datasets relating to the deep learning algorithm includes extracting features from the dataset using computer vision-based feature extraction.
[0023] In some examples, extracting features from the dataset using computer vision-based feature extraction includes creating summary information of the dataset and generating image data using the summary information. Extracting features from the dataset using computer vision-based feature extraction also includes feeding the image data into a neural network, extract the outputs of an intermediate layer of the neural network, and using the outputs of the intermediate layer as features of the dataset.
[0024] In some examples, extracting features from the dataset includes generating a graph-spectral heat-trace signature of the data set and generating a degree-density histograms using the dataset.
[0025] In some examples, the method further includes generating distributional statistics from text and image embeddings of the data set.
[0026] According to another aspect of the present disclosure, there is provided a non-transitory computer program product comprising computer-implemented instructions to cause a computer system to execute the above method of modifying parameters of a deep learning algorithm.
[0027] According to yet another aspect of the present disclosure, there is provided a computer system comprising one or more computer processors and one or more computer readable storage media for storing computer-implemented instructions, wherein the one or more computer processors are configured to execute the computer-implemented instructions to cause the system to perform the above method of modifying parameters of a deep learning algorithm.
[0028] According to yet another aspect of the present disclosure, there is provided a method of extracting features from a dataset used to train a deep learning model. The method comprises separating the dataset into a training dataset and a testing dataset and determining the target variable of the deep learning model and the nature of the deep learning model. The method also comprises selecting one or more baseline machine learning models based on the nature of the deep learning model and training the one or more baseline machine learning models using the training dataset. The method also comprises evaluating the performance of the one or more baseline machine learning models using the testing data set using one or more performance metrics and using the evaluation results as features of the dataset.
[0029] In some examples, the nature of the deep learning model is regression.
[0030] In some examples, the one or more baseline machine learning models include one or more of a linear regression baseline model and a decision tree regressor baseline model.
[0031] In some examples, the one or more performance metrics include one or more of Means Square Error, Root Mean Square Error, Mean Absolute Error, Mean Absolute Percentage Error, and R-squared.
[0032] In some examples, the nature of the deep learning model is classification.
[0033] In some examples, the one or more baseline machine learning models includes one or more of a logistic regression baseline machine learning model and a decision tree classifier machine learning model.
[0034] In some examples, the one or more performance metrics include one or more of accuracy and F1 score.
[0035] According to yet another aspect of the present disclosure, there is provided a non-transitory computer program product comprising computer-implemented instructions to cause a computer system to execute the above method of extracting features from a dataset used to train a deep learning model.
[0036] According to yet another aspect of the present disclosure, there is provided a computer system comprising one or more computer processors and one or morecomputer readable storage media for storing computer-implemented instructions, wherein the one or more computer processors are configured to execute the computer-implemented instructions to cause the system to perform the above method of extracting features from a dataset used to train a deep learning model.
[0037] According to yet another aspect of the present disclosure, there is provided a method of extracting features from a dataset. The method comprises creating summary information of the dataset and generating image data using the summary information. The method also comprises feeding the image data into a neural network, extracting the outputs of an intermediate layer of the neural network, and using the outputs of the intermediate layer as features of the dataset.
[0038] In some examples, the summary information includes a statistical table relating to the columns of the dataset.
[0039] In some examples, the statistical table includes one or more of normalized numeric values, mean, and variance of values for each column in the dataset.
[0040] In some examples, generating image data using the summary information includes resizing the summary information to replicate the format of an image.
[0041] According to yet another aspect of the present disclosure, there is provided a method of extracting features from a dataset used to train a deep learning model. The method comprises generating a graph-spectral heat-trace signature of the data set and generating a degree-density histograms using the dataset.
[0042] In some examples, the method further includes generating distributional statistics from text and image embeddings of the data set.
[0043] According to yet another aspect of the present disclosure, there is provided a non-transitory computer program product comprising computer-implemented instructions to cause a computer system to execute the above method of extracting features from a dataset.
[0044] According to yet another aspect of the present disclosure, there is provided a computer system comprising one or more computer processors and one or more computer readable storage media for storing computer-implemented instructions, whereinthe one or more computer processors are configured to execute the computer-implemented instructions to cause the system to perform the above method of extracting features from a dataset.
[0045] According to yet another aspect of the present disclosure, there is provided a computer-implemented system for predicting and optimizing environmental resource consumption of deep learning workflows prior to execution. The system comprises one or more processors and a memory storing instructions which, when executed, cause the system to: receive source code defining a deep learning model, a dataset to be used during training, and a set of user-selected training configurations; extract a plurality of code-level features from the source code, the code-level features comprising at least one of: model architectural parameters, hyperparameter definitions, optimizer or training loop structure, and computational operations identifiable through abstract syntax tree analysis; extract a plurality of dataset-level features from the dataset, the dataset-level features comprising at least one of: statistical properties of dataset distribution, class imbalance information, correlation and variance metrics, and an image-based representation of dataset statistics processed through a pre-trained computer vision model to generate a dataset embedding; construct a unified multi-modal feature representation by combining the code-level features and the dataset-level features; input the multi-modal feature representation and the user-selected training configurations into: a first surrogate model configured to predict one or more performance metrics of the deep learning model, and a second surrogate model configured to estimate resource consumption metrics prior to execution, the resource consumption metrics comprising energy usage, carbon footprint, and water footprint, the second surrogate model incorporating region-specific environmental intensity data; execute a multi-objective optimizer that receives the predicted performance metrics and the estimated resource consumption metrics and computes a set of candidate modifications to the code, dataset usage, or training configurations that reduce environmental footprint while maintaining a predefined threshold of predicted performance; and generate and output one or more recommendations comprising at least one of: modifications to hyperparameters, changes to model architecture, alterations to batch size, precision, or training duration, and suggested alternative baseline models, wherein the recommendations are configured toreduce the predicted resource consumption of the deep learning workflow prior to execution.
[0046] According to yet another aspect of the present disclosure, there is provided a computer-implemented method for predicting and optimizing the environmental impact of a deep learning workflow prior to execution. The method comprises receiving source code defining a deep learning model, a dataset, and user-selected training configurations; extracting code-level features from the source code using rule-based analysis and abstract syntax tree parsing; extracting dataset-level features including statistical metrics and a computer-vision-based embedding of dataset characteristics; generating a multimodal feature representation by combining the code-level and dataset-level features; predicting performance metrics using a first surrogate model; and estimating resource consumption metrics, including carbon footprint, water footprint, and energy usage, using a second surrogate model that incorporates region-specific environmental intensity data; performing multi-objective optimization to identify recommended modifications that reduce environmental footprint while maintaining performance; and outputting the recommended modifications prior to execution of the deep learning workflow.
[0047] According to yet another aspect of the present disclosure, there is provided a non-transitory computer-readable medium storing instructions that, when executed by one or more processors, cause a system to perform the steps of: receiving code-level and dataset-level inputs defining a deep learning workflow; extracting code-level features and dataset-level features, including image-based dataset embeddings generated via a computer vision model; predicting performance and environmental footprint using surrogate models; and generating recommendations determined through multi-objective optimization to reduce environmental impact prior to model execution.
[0048] According to yet another aspect of the present disclosure, there is provided a system for extracting dataset-level representations for environmental and performance prediction, the system comprising: a statistical analysis module configured to compute distributional, correlation, and variance metrics from a dataset; a dataset-encoding module configured to generate a fixed-size image representation of dataset statistics; a feature-extraction module comprising a pre-trained computer vision model configured toproduce a dataset embedding from the image representation; and an output interface configured to supply the dataset embedding to a surrogate model for predicting resource consumption and performance metrics prior to execution of a deep learning workflow.
[0049] According to yet another aspect of the present disclosure, there is provided a system for region-aware environmental estimation of deep learning workflows prior to execution. The system comprises a database of real-time or periodically updated regional environmental intensity metrics comprising carbon-intensity, water-intensity, and energysource composition; a surrogate environmental model configured to receive a multi-modal feature representation of the workflow and output predicted resource consumption dependent on the selected region and an optimization engine configured to compute alternative training configurations that reduce environmental footprint based on regional conditions.
[0050] The methods and systems provided introduce multiple technical improvements over known resource tracking tools. For example, they integrate rule-based code analysis, NLP-based model introspection, and computer-vision-based dataset representations to create a unified multi-modal feature representation. This combination enables a level of granularity and predictive capability not found in existing systems.
[0051] Moreover, the methods and systems disclosed herein predict performance metrics and environmental footprint - including carbon, water, and energy - before executing the deep learning code. This pre-execution estimation provides a significant technical advantage, namely that of enabling developers to avoid computationally expensive training runs that would otherwise generate unnecessary environmental impact.
[0052] Furthermore, the methods and systems disclosed herein perform multiobjective optimization that considers both predictive accuracy and resource footprint simultaneously. This optimizer identifies specific modifications; such as batch size adjustments, architecture changes, or baseline shifts; that reduce resource usage with minimal or no loss of accuracy.
[0053] Other features and advantages of the present disclosure will become apparent from the following detailed description taken together with the accompanyingdrawings. It should be understood, however, that the detailed description and the specific examples, while indicating preferred embodiments of the application, are given by way of illustration only, since various changes and modifications within the scope of the application will become apparent to those skilled in the art from this detailed description.DRAWINGS
[0054] For a better understanding of the various embodiments described herein, and to show more clearly how these various embodiments may be carried into effect, reference will be made, by way of example, to the accompanying drawings which show at least one example embodiment, and which are now described. The drawings are not intended to limit the scope of the teachings described herein.
[0055] In the drawings:
[0056] FIG. 1 is a schematic representation of a computer network including an example computing system suitable for implementing systems and methods in accordance with embodiments of the present disclosure;
[0057] FIG. 2 is a schematic representation of a computing device suitable for implementing systems and methods in accordance with embodiments of the present disclosure;
[0058] FIG. 3 is a schematic representation of a system in accordance with embodiments of the present disclosure;
[0059] FIG. 4 is a block diagram representing a method in accordance with embodiments of the present disclosure;
[0060] FIG. 5 is a schematic representation of a data collection and training environment suitable for training deep learning models in accordance with embodiments of the present disclosure;
[0061] FIG. 6 is a schematic representation of a system for extracting features in accordance with embodiments of the present disclosure;
[0062] FIG. 7 is a flow chart representing a method of extracting features from datasets using baseline machine learning models in accordance with embodiments of the present disclosure;
[0063] FIG. 8 is a flow chart representing a method of extracting features from datasets using computer vision-based machine learning models in accordance with embodiments of the present disclosure; and
[0064] FIG. 9 is a flow chart representing a method of extracting features from a multi-modal dataset in accordance with embodiments of the present disclosure.
[0065] Further aspects and features of the example embodiments described herein will appearfrom the following description taken together with the accompanying drawings.DESCRIPTION OF VARIOUS EMBODIMENTS
[0066] Various embodiments in accordance with the teachings herein will be described below to provide an example of at least one embodiment of the claimed subject matter. No embodiment described herein limits any claimed subject matter. The claimed subject matter is not limited to devices, systems, or methods having all the features of any one of the devices, systems, or methods described below or to features common to multiple or all of the devices, systems, or methods described herein.
[0067] It is possible that there may be a device, system, or method described herein that is not an embodiment of any claimed subject matter. Any subject matter that is described herein that is not claimed in this document may be the subject matter of another protective instrument, for example, a continuing patent application, and the applicants, inventors, or owners do not intend to abandon, disclaim, or dedicate to the public any such subject matter by its disclosure in this document.
[0068] It will be appreciated that for simplicity and clarity of illustration, where considered appropriate, reference numerals may be repeated among the figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will also be understood by those of ordinary skill in the art that the embodiments described herein may be practiced without these specific details. In otherinstances, well-known methods, procedures, and components have not been described in detail so as not to obscure the embodiments described herein. Also, the description is not to be considered as limiting the scope of the embodiments described herein.
[0069] It should also be noted that the terms “connected” or “connecting” as used herein can have several different meanings depending in the context in which these terms are used. For example, the terms connected or connecting can have a mechanical, electrical or computational connotation. For example, as used herein, the terms connected or connecting can indicate that two elements or devices can be directly connected to one another or connected to one another through one or more intermediate elements or devices via an electrical signal, electrical connection, or a mechanical element depending on the particular context.
[0070] It should also be noted that, as used herein, the wording “and / or” is intended to represent an inclusive-or. That is, “X and / or Y” is intended to mean X or Y or both, for example. As a further example, “X, Y, and / or Z” is intended to mean X or Y or Z or any combination thereof. It should also be noted that terms of degree such as “substantially”, “about” and “approximately” as used herein mean a reasonable amount of deviation of the modified term such that the end result is not significantly changed. These terms of degree may also be construed as including a deviation of the modified term, such as by 1%, 2%, 5%, or 10%, for example, if this deviation does not negate the meaning of the term it modifies.
[0071] Furthermore, although method steps may be described (in the disclosure and / or in the claims) in a sequential order, such methods may be configured to work in alternate orders. In other words, any sequence or order of steps that may be described does not necessarily indicate a requirement that the steps be performed in that order. The steps of methods described herein may be performed in any order that is practical. Further, some steps may be performed simultaneously.
[0072] Some elements herein may be identified by a part number, which is composed of a base number followed by an alphabetical or numerical suffix (e.g., 184A, or 184₁). Multiple elements herein may be identified by part numbers that share a base number in common and that differ by their suffixes (e.g., 184₁, 184₂, and 184₃). Allelements with a common base number may be referred to collectively or generically using the base number without a suffix (e.g., 184).
[0073] As used herein, the term “computing device” and related terms are not limited to any particular type of computer system and encompasses servers, desktop computers, laptop computers, networked mobile wireless telecommunication computing devices such as smartphones, tablet computers, as well as other types of computer systems.
[0074] As used herein, the term “machine learning” means a branch of artificial intelligence (AI) that focuses on developing algorithms and models that enable computers to learn from and make predictions or decisions based on data. Rather than being explicitly programmed to perform a task, a machine learning model identifies patterns and relationships within data and uses this information to improve its performance over time. It can be applied in various domains such as image recognition, natural language processing, recommendation systems, and predictive analytics, allowing systems to adapt and respond to new information without constant human intervention.
[0075] As used herein, the term “deep learning” means a subset of machine learning that uses neural networks with a relatively large number of layers (often called deep neural networks) to model complex patterns and representations in data.
[0076] As used herein, the term “deep learning algorithm” means a set of rules or procedures that allows a computer system to automatically learn patterns and make decisions based on data without being explicitly programmed for each task.
[0077] As used herein, the term “deep learning code” means the written script created by developers, including a neural network’s architecture, hyperparameters, and training procedures.
[0078] As used herein, the term “deep learning model” means a mathematical representation or system built using data to perform specific tasks, such as classification, prediction, or decision-making, and is the output generated by training an algorithm on a dataset.
[0079] As used herein, the term “deep learning project” means the deep learning code and any datasets used for training the model associated with the code. A trained model does not form part of a deep learning project.
[0080] As used herein, the term “carbon footprint” means the amount of greenhouse gases, particularly carbon dioxide (CO₂), emitted directly or indirectly by a computing process.
[0081] As used herein, the term “water footprint” means a measure of the total volume of directly and indirectly consumed or polluted during computational activities associated with Al model training and inference.
[0082] As used herein, the term “resource footprint” includes the water footprint and / or the carbon footprint.
[0083] As used herein, the term “performance metrics” means any set of measurements used to evaluate model quality including, but not limited to, precision, recall, F1 score, accuracy, Mean Absolute Error (MAE), and Root Mean Squared Error (RMSE). Performance metrics may be used to indicate a model’s effectiveness in achieving desired outcomes and guide performance improvements.
[0084] As used herein, the term “surrogate model” means any machine learning model trained to approximate the behavior of another (often more complex) model or system. As used in accordance with embodiments found herein, surrogate models estimate outcomes such as resource footprint and model performance based on extracted features rather than direct, costly computations.
[0085] As used herein, the term “carbon intensity” means the amount of carbon dioxide (CO₂) emitted per kilowatt-hour of electricity consumed, typically measured in grams of CO₂ per kWh.
[0086] As used herein, the term “water intensity” means the amount of water consumed or polluted per unit of electricity generated.
[0087] As used herein, the term “water intensity” means water intensity and / or carbon intensity.
[0088] As used herein, the term “optimization algorithm” means any mathematical procedure used to adjust the weights of a machine learning model during training to minimize the loss function. Non-limiting examples of optimization algorithms include SGD, Adam, and RMSprop.
[0089] As used herein, the term “hyperparameter” means any configurable setting of a deep learning model, such as learning rate, batch size, number of epochs, and dropout rate, which must be set before training begins.
[0090] As used herein, the term “code complexity” means any measure of the intricacy of the code structure. Code complexity is often based on metrics such as cyclomatic complexity and maintainability index.
[0091] The example embodiments of the devices, systems, or methods described in accordance with the teachings herein may be implemented as a combination of hardware and software. For example, the embodiments described herein may be implemented, at least in part, by using one or more computer programs, executing on one or more programmable devices comprising at least one processing element and at least one storage element (i.e., at least one volatile memory element and at least one nonvolatile memory element). The hardware may comprise input devices including one or more of a touch screen, a keyboard, a mouse, buttons, keys, sliders, and the like, as well as one or more of a display, a printer, and the like depending on the implementation of the hardware.
[0092] It should also be noted that there may be some elements that are used to implement at least part of the embodiments described herein that may be implemented via software that is written in a high-level programming language. The program code may be written in Rust, C++, C#, JavaScript, Python, or any other suitable programming language and may comprise modules or classes, as is known to those skilled in the art. Alternatively, or in addition thereto, some of these elements implemented via software may be written in assembly language, machine language, or firmware as needed. In any case, the language may be a compiled or interpreted language.
[0093] At least some of these software programs may be stored on a computer readable medium such as, but not limited to, a ROM, a magnetic disk, an optical disc,solid-state storage, a USB key, and the like that is readable by a device having a processor, an operating system, and the associated hardware and software that is necessary to implement the functionality of at least one of the embodiments described herein. The software program code, when read by the device, configures the device to operate in a new, specific, and predefined manner (e.g., as a specific-purpose computer) in order to perform at least one of the methods described herein.
[0094] At least some of the programs associated with the devices, systems, and methods of the embodiments described herein may be capable of being distributed in a computer program product comprising a computer readable medium that bears computer usable instructions, such as program code, for one or more processing units. The medium may be provided in various forms, including non-transitory forms such as, but not limited to, one or more diskettes, compact disks, tapes, chips, and magnetic and electronic storage. In alternative embodiments, the medium may be transitory in nature such as, but not limited to, wire-line transmissions, satellite transmissions, internet transmissions (e.g., downloads), media, digital and analog signals, and the like. The computer useable instructions may also be in various formats, including compiled and non-compiled code
[0095] As climate change progresses, regional water scarcity is expected to intensify. Operating Al infrastructure in such areas not only contributes to water stress but also creates long-term sustainability risks for governments and enterprises. Ignoring water footprint considerations today may result in operational bottlenecks, financial penalties, and community opposition in the future.
[0096] A further challenge lies in accurately calculating water intensity associated with Al workloads. Unlike carbon intensity, which is more commonly tracked and standardized, water intensity (liters per kilowatt-hour) varies significantly based on regional electricity generation mixes and cooling techniques in data centers. Determining precise water consumption requires granular data about energy sources (e.g., coal, gas, renewables) and data center cooling methods (e.g., evaporative vs. air cooling). However, this data is often unavailable or difficult to interpret, making it extremely difficult for developers to estimate their models’ true water footprint. Without clear, accessible toolsor frameworks to calculate water intensity, Al practitioners are left in the dark about a critical dimension of environmental impact.
[0097] Referring now to FIG. 1, there is shown a computer network 100 that comprises an example embodiment of a system implementing the systems and methods described herein. More particularly, the computer network 100 comprises a wide area network 102 such as the Internet to which various computing devices 104x, and cloud computing service 106 are communicatively connected. The cloud computing service 106 may comprise a number of computing devices 108 networked together to collectively perform various computing functions. For example, in the context of machine learning, the cloud computing service 106 may host machine learning models and code development environments, such as those described herein, and associated functionality.
[0098] Referring now to FIG. 2, there is depicted an example embodiment of one of the computing devices 108 that comprises the cloud computing service 106. The computing device 108 comprises processors 202 that control the computing device’s 108 overall operation. The processors 202 are communicatively connected to and control several subsystems. Processors 202 may include one or more central processing units (CPUs) and / or graphical processing units (GPU) and / or Tensor Processing Units (TPUs). The one or more GPUs and / or TPUs may be used for computational purposes as adjuncts to, or instead of, one or more central processing units (CPU), for mathematical calculations.
[0099] These subsystems comprise user input devices 204, which may comprise, for example, any one or more of a keyboard, mouse, touch screen, voice control; random access memory (“RAM”) 206, which stores computer program code for execution at runtime by the processor 202; non-volatile storage 208, which stores the computer program code executed by the RAM 206 at runtime; a display controller 210, which is communicatively coupled to and controls a display 212; and a network interface 214, which facilitates network communications with the wide area network 104 and the other computing devices 108 in the cloud computing service 106.
[0100] The non-volatile storage 208 has stored on it computer program code that is loaded into the RAM 206 at runtime and that is executable by processors 202. Whenthe computer program code is executed by the processors 202, the processors 202 cause the computing device 108 to implement methods such as those described herein. Additionally, or alternatively, the computing devices 108 may collectively perform the method described herein using distributed computing. While the system depicted in FIG.2 is described specifically with respect to one or more of the computing devices 108, analogous versions of the system may also be used within computing devices 104x.
[0101] FIG. 3 shows a schematic representation of a system 300 in accordance with embodiments of the present disclosure and FIG. 4 shows a block diagram representing a method in accordance with embodiments of the present disclosure.
[0102] In some embodiments, the system 300 offers a suite of features designed to help users develop more energy-efficient code with a focus on minimizing carbon emissions and / or water intensity, without significantly impacting on code efficiency and performance.
[0103] In accordance with some embodiments, the system 300 includes a custom code development environment 301, such as an Integrated Development Environment (IDE) or Virtual Studio (VS) Code™. This tool may be installed on the developer side to collect code and dataset information from the deep learning project to be analyzed. As used herein, the term deep learning project includes a combination of deep learning code and the data set used to train the resulting deep learning model. The custom code development environment 301 allows users to write, run, and manage their code. In some embodiments, the custom code development environment 301 can be either a standalone desktop application provided or an extension for VS Code. In either embodiment, developers can track the performance and carbon and / or water footprint of their code in real-time. In some embodiments, the custom code development environment 301 may be a web application. The custom code development environment 301 may provide an extensive dashboard for monitoring these metrics, providing a comprehensive environment for sustainable software development.
[0104] At step 401, the custom code development environment 301 collects information relating to the code being developed within the project and one or more datasets being used to train the deep learning model associated with project. Informationrelating to the code being developed within the project may include, but is not limited to, neural network architecture information (e.g., number of layers, types of layers, activation functions), hyperparameters (e.g., learning rate, batch size, epochs), and the optimization algorithm used. Information relating to datasets within the project may include, but is not limited to, the size of the dataset (e.g., number of records and features), types of data (e.g., numerical, categorical), feature distributions, and relationships between features (e.g., correlations). This information helps downstream models estimate both the performance and resource footprint of the overall deep learning project.
[0105] The custom code development environment 301 is also operable to determine the geographic location of the computing resource used to run the deep learning code and associated geographic location information is generated at step 307. In some embodiments, the geographic location of the computing resource may be determined using the IP address or cloud region metadata from providers such as Amazon Web Services™ (AWS™), Azure™, or Google Cloud™. These platforms provide APIs to identify the region where the resource operates. This location data is then matched to carbon intensity databases through services such as Electricity Maps™ or WattTime™, which offer APIs to retrieve real-time carbon intensity (measured in grams of CO₂ per kWh). The integration ensures precise, location-specific carbon footprint calculations for each computational task.
[0106] In contrast to prior art solutions which calculate energy consumption and carbon emissions of entire computing devices, resource tracker service 308 focusses on specific programs without being overly general. It can understand the carbon footprint of a specific deep learning code by understanding the proportions of CPU, GPU, and RAM energy consumption allocated to the program. In some embodiments, resource tracker service 308 tracks the carbon footprint of specific programs by measuring the energy consumption of the CPU, GPU, and RAM, etc. specifically used by the deep learning being analyzed. Tools such as Nvidia-smi track GPU usage, while operating system utilities (e.g., Linux Powerstat) monitor CPU and memory usage. These metrics may then be combined with real-time carbon intensity data to estimate the carbon footprint for running the particular deep learning code.
[0107] The real-time carbon intensity information corresponds to the relative environmental impact of the electricity produced in the determined geographic location.
[0108] In addition to carbon footprint estimation, assessing the water footprint of Al model training and inference provides a more comprehensive view of environmental sustainability in Al development. The water footprint measures the total volume of water directly and indirectly consumed or polluted during computational activities associated with Al model training and inference.
[0109] In some embodiments, the water footprint for Al training is calculated using a two-step approach, consistent with the carbon footprint methodology described in more detail elsewhere herein. First, the systems and methods described herein estimate computational workload through its surrogate model, then translates it into electricity consumption using hardware-specific power profiles. Second, electricity consumption is mapped to water usage using the Water Intensity Factor (WIF), which reflects the regional electricity generation mix and cooling methods. Water Intensity Factor (WIF) represents the volume of water (liters) consumed or polluted per unit of electricity generated (kWh). WIF depends on the specific regional electricity generation mix and cooling methodologies.
[0110] In accordance with the methods and systems described herein, the Water Intensity Factor (WIF) may be determined using existing water-energy nexus tools and publicly available calculators. For example, WIF will be calculated by identifying the regional electricity generation mix, matching it with standardized water intensity values for each energy source, and then computing a weighted average based on these proportions.
[0111] Once the project information is collected by the custom code development environment 301, the code and datasets contained in the project information are sent to the code and dataset feature extractor module 302, which extracts features of the code and the datasets, at step 402, as described in more detail elsewhere herein. The output of the code and dataset feature extractor module 302 is one or more datasets of code features and one or more datasets of dataset features.
[0112] In some embodiments, the one or more datasets of code features and one or more datasets of dataset features can then be subject to feature engineering. Forexample, in some embodiments, various subsets of code features and / or dataset features may be selected based on their relevance to the predictions performed by the one or more surrogate performance models 303 and / or the surrogate resource intensity model 304.
[0113] Once feature extraction, and in some embodiments, subsequent feature engineering, is performed, the selected features of the one or more datasets of code features and one or more datasets of dataset features are inputted into the one or more surrogate performance models 303 and the surrogate resource intensity model 304 at steps 403 and 404. All extracted features are initially collected, including, but not limited to, hardware usage (e.g., CPU / GPU consumption, memory usage), carbon intensity, code complexity, model architecture, hyperparameters, etc. These features are then passed through different feature selection algorithms depending on whether the goal is to estimate performance or carbon footprint. For example, in some embodiments, for the surrogate resource intensity model 304, feature selection algorithms may prioritize hardware-related features like CPU / GPU usage and real-time carbon intensity, whereas for surrogate performance models 303, feature selection may focus on features like code complexity, model architecture, and hyperparameters affecting speed and accuracy. As will be appreciated by the skilled reader, the reason the system uses multiple surrogate performance models 303 is that each surrogate performance model 303 may be trained to predict a different performance metric, such as recall (also known as sensitivity or true positive rate), F1-score, Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), and R-squared. While surrogate carbon emissions model, surrogate water usage model and each surrogate performance model is specialized, they all start from the same comprehensive dataset and then may undergo feature selection tailored to optimize for specific outcomes.
[0114] The output of the one or more surrogate performance models 303 and the surrogate resource intensity model 304 are then used by the efficiency and performance estimation module 305 and the carbon / water footprint estimation module 306, respectively. The efficiency and performance estimation module 305 may be implemented as an algorithm that combines the outputs of the surrogate performance models 303 to calculate overall performance metrics, such as execution time, accuracy, and model throughput. In some embodiments, it is not itself a machine learning model but uses aweighted aggregation approach, where weights are derived based on the importance of each performance metric for the application context.
[0115] The efficiency and performance estimation module 305 then estimates the efficiency and performance of the code associated with the project at step 406. The carbon / water footprint estimation moduleresource footprint estimation module 306 may employ an algorithm that integrates the output from the surrogate resource intensity model 304 with real-time carbon intensity data to produce a holistic estimate. In some embodiments, it may consider hardware-specific energy consumption metrics and may apply a formula that combines these with regional carbon intensity data to derive the carbon footprint.
[0116] Then, at step 405, the carbon / water footprint estimation moduleresource footprint estimation module 306 estimates the carbon footprint of the code associated with the project using the output of the surrogate resource intensity model 304 and the realtime resource intensity information returned from the service which returns real-time resource intensity information at step 308. The resource footprint estimation primarily focuses on the energy consumption during the training phase of the deep learning model, which involves the execution of the code. This includes the energy used by the hardware (e.g., CPU / GPU and memory) during training, as well as the resource intensity of the power grid supplying the electricity at that time. In some embodiments, the energy consumption during the model’s deployment (e.g., inference) may also be used to produce the estimation. The key focus of the resource footprint estimation model 306 is on the resource footprint generated while the code is being executed to train the model. The estimation process focuses on leveraging surrogate modeling techniques and hardware usage metrics to predict the energy consumption of training, while integrating real-time resource intensity data. This preemptive estimation offers developers actionable insights prior to code execution, enabling optimization of parameters to minimize environmental impact.
[0117] Then, at step 407, the optimizer 309 of the system 300 determines changes that can reduce the resource footprint of the code and / or improve the efficiency and / or performance of the code. The optimizer 309 is a core component that deliversrecommendations aiming to simultaneously reduce carbon emissions, water usage and boost code performance. As will be appreciated by the skilled reader, in some instances, it may not be possible to find a modification to the code that will both reduce the resource footprint and improve the efficiency and / or performance of the code. In some embodiments, optimizer 309 employs multi-objective optimization to minimize resource footprint while maintaining or improving performance, with configurable weights allowing developers to prioritize objectives based on project requirements. In some embodiments, the function involves minimizing energy consumption while ensuring performance metrics (e.g., accuracy) remain above a certain threshold. In scenarios where trade-offs are necessary, the system may allow developers to set weights or priorities, adjusting how much emphasis is placed on reducing resource footprint versus improving performance.
[0118] Finally, at step 408, recommendations 310 are generated by the optimizer 309 based on the changes determined at step 407. These recommendations 310 are then communicated to a developer via the custom code development environment 301. The optimizer 309 may generate tailored recommendations to balance performance and resource footprint reduction. An example recommendation may be “reduce batch size from 64 to 32, lowering GPU memory usage by 15% and decreasing the resource footprint, with an accuracy impact of less than 1%”. Another example recommendation may be “switch optimizer from Adam to SGD, reducing GPU utilization by 10%, with a trade-off of slightly slower convergence”. Yet another example recommendation may be “schedule training jobs during periods of low-carbon-intensity power supply (e.g., renewable energy availability in the geographic region) to cut emissions by 20% without altering the code”. Such recommendations allow developers to prioritize their goals dynamically.
[0119] The systems and methods disclosed herein provide data collection which aims to create comprehensive datasets of features that can be used to train reliable machine learning models. In some embodiments, the systems and methods disclosed herein leverage two main sources for data collection, namely a custom development environment and publicly-available sources of code. FIG. 5 shows a schematic representation of a data collection and training environment suitable for training deep learning models in accordance with embodiments of the present disclosure.
[0120] The first source of data may be a custom development environment 502, such as an Integrated Development Environment (IDE) or Virtual Studio (VS) Code™ which is described in more detail elsewhere herein. This tool may be installed on the developer side to collect and send run-time data to the systems described herein.
[0121] In the first source of data, the In the VS Code™ environment, there may be an integrated extension. When a user develops Artificial Intelligence (Al) code, such as deep learning code, within the extension, it may be saved on a computing resource in a cloud computing environment 504, such as a cloud Virtual Machine (VM). At the same time, the extension may comprise a feature extraction module 503 which extract features from both the Al code snippets and the data utilized by the user, as described in more detail elsewhere herein. As used herein, a “code snippet” means any small block of reusable code that performs a specific task or demonstrates a particular programming concept.
[0122] In some embodiments, once the features are extracted, the process branches into a pre-runtime path and a runtime path 507. In the pre-runtime path, the geographic location of the computing resource used to run the Al code is determined, as described elsewhere herein in more detail, and associated geographic location information is generated by module 506. Once generated, the geographic location information is passed, via an external API for example, to a resource tracker service 506, as also described in more detail elsewhere herein, which returns real-time resource intensity information. The real-time resource intensity information corresponds to the relative environmental impact of the electricity produced in the determined geographic location.
[0123] In parallel, a runtime path 507 is implemented in which the resource consumption monitoring module 508 monitors the computing resource’s consumption while running the Al code, including Central Processing Unit (CPU) usage, Graphical Processing Unit (GPU) usage, Random Access Memory (RAM) usage, storage usage and input / output operations. The result of this step is that the system now has resource consumption information indicative of how much energy is used by the code during runtime.
[0124] Then, utilizing the resource consumption information and the real-time resource intensity information, a resource footprint calculation module 509 calculates resource footprint of running the Al code on the computing resource in that geographic location. This resource footprint is indicative of the environmental cost of the computational operations required during runtime.
[0125] The second source of data may be publicly available sources of code from resources such as GitHub™ and Kaggle™. In some embodiments, this data may be collected by an automated data collection module 501 which includes web crawling functionality and / or various available Application Programming Interfaces (APIs). The automated data collection module 501 automatically extracts, processes, and stores data, which is useful fortasks like dataset analysis and code snippet analysis, as described in more detail elsewhere herein.
[0126] In some embodiments, the automated data collection module 501 is operable to implement a web crawler, also known as a spider, web-bot or bot, is a software program designed to automatically browse and retrieve web pages by systematically navigating through website links.
[0127] Automated data collection module 501 automatically collects and cleans notebooks and datasets from platforms such as those mentioned elsewhere herein. It begins by downloading notebooks and applying a series of processing steps includes actions such as removing large images or truncating long logs to reduce size. The cleaned data may then be stored. The system may also integrate web crawling techniques to enhance data management capabilities, ensuring datasets are not only accessible but also linked to their corresponding notebooks. This linkage is important for clear representation of dependencies and usages, allowing each analysis derived from a notebook to be precisely traced back to its source dataset. Automated data collection module 501 also manages the storage of data retrieved by crawlers. This may ensure that the data can be saved in various formats (e.g., CSV, JSON, XML, etc.), organizing it based on different configurations specified.
[0128] Once the information is collected, the code and datasets are sent to the code and dataset feature extractor module 503, which extracts features of the code andthe datasets, as described in more detail elsewhere herein. The output of the code and dataset feature extractor module 503 is one or more datasets of code features and one or more datasets of dataset features. In some embodiments, the one or more datasets of code features and one or more datasets of dataset features can then be subject to feature engineering by feature engineering module 505. For example, in some embodiments, various subsets of code features and / or dataset features may be selected based on their relevance to the predictions performed by the one or more surrogate performance models and / or the surrogate resource emissions model(s).
[0129] Once a comprehensive dataset of features is generated, it can be used to train the one or more surrogate performance models by way of the surrogate performance model training module 512. Each performance surrogate model aims to predict a single metric, such as Mean Absolute Error (MAE), Mean Square Error (MSE), Root Mean Square Error (RMSE) and accuracy. The comprehensive dataset of features can also be used to train the resource emissions models by way of the surrogate resource emissions model training module 511.
[0130] It is worth mentioning that the raw data Automated data collection module 501 cannot be directly used to train the surrogate models. There is a need to process the data and extract valuable features that could be used by the deep learning models.
[0131] FIG. 6 shows a schematic representation of a system for extracting features in accordance with embodiments of the present disclosure.
[0132] The code and dataset feature extraction module 605 of the methods and system described herein is an innovative solution for extracting features from code and datasets. Based on these extracted features, multiple surrogate models can be trained for different purposes, as described in more detail elsewhere herein.
[0133] In some embodiments, additional feature engineering may be applied to the extracted features. Feature engineering may include feature selection, Principal Component Analysis (PCA), normalization, and missing values handling.
[0134] The code feature extraction modules described herein use two methods to extract a comprehensive set of features from the code snippet: a rule- based featuremethods 607 and a Natural Language Processing (NLP)-based methods 608. Rule-based methods rely on Abstract Syntax Tree (AST) analysis to extract structural and quality-related features, such as cyclomatic complexity, maintainability index, and function definitions. By contrast, NLP-based methods leverage Large Language Models (LLMs), such as GPT models, Codex or CodeBERT, to derive high-level insights like ML problem type, model architecture, and hyperparameters. This dual approach ensures comprehensive coverage of structural, semantic, and contextual attributes.
[0135] The rule-based methods 607 systematically extract features from code snippets by applying predefined rules based on the structure of the code. This method primarily utilizes the Abstract Syntax Tree (AST), which is a hierarchical diagram that represents the structure of the code in a way that makes it easier to analyze and manipulate by software tools. Each node of this tree represents a construct occurring in the code snippet. ASTs are well known in the field of computer science, especially for analyzing programming languages and designing compilers. A key aspect of the present disclosure is that the resource footprint and performance predictions are generated prior to executing the deep learning model.
[0136] The rule-based methods 607 for feature extraction operate through a sequence of steps, beginning with the identification and aggregation of code snippets that are output from the automated data collection module 501 and / or the custom code development environment 502, described in more detail elsewhere herein.
[0137] In some embodiments, a first preprocessing step initiates with the extract the code cells from code snippet and the script undergoes a cleansing phase where special characters and comments (% and #) are stripped away. Then, the remaining source code cells are concatenated to form a continuous block of code. An AST parsing step may then be performed in which the cleaned version of the code is then parsed to construct an Abstract Syntax Tree (AST), which deconstructs the code into a hierarchical structure. This tree precisely maps out the syntactic constructs of the code, differentiating between the various components such as expressions, statements, and control flow elements. Then, a feature extraction step may be performed in which, using the AST, a detailed analysis is conducted to quantify structural elements, assess node types, andevaluate code quality metrics. A post-processing step may then be performed in which, after extraction, the relevant features are selected and encoded, employing binary, counting, and statistical methods to translate qualitative aspects into quantitative data. Finally, a feature set compilation step may be performed in which individual features are concatenated to form a comprehensive feature set that encapsulates the multifaceted attributes of the code snippet.
[0138] The features extracted by rule-base methods are organized into three distinct categories. First, structural node count features are a way of understanding the code by counting different types of nodes within its structure. By counting different types of nodes, one can obtain a quantitative sense of the complexity and structure of the code. For example, more nodes related to functions or control flows might indicate a more complex program that performs a lot of processing and decision-making. Table 1 lists various exemplary structural node count features along with a brief description and sample data.Features Description Sample count_tokens Count tokens when consider code snippet like a text 2841 depth_of_AST Depth of Abstract Syntax T ree (AST) 12 count_nodes Count the nodes in AST 2427 count_edges Count the edges in AST 2426 count_imports Count of import and from_import 13 count_class_nodes Count of class nodes 0 count_function_nodes Count of function nodes 3 count_call_function_nodes Count of call function nodes 184 count_control_flow_nodes Count of control flow nodes like if, for, while, if 7expression and asyncforcount_file_handling_nodes Count of file handling nodes 0 count_exception_handling_nodes Count of Try nodes 0 count_expression_nodes Count of expression nodes 106 count_assignment_nodes Count of assignment nodes 84 count_literal_nodes Count of literal nodes 314 count_binary_operations Count of binary operations 24 count_unary_operations Count of unary operations 6 count_global_nodes Count of global nodes 0count_nonlocal_nodes Count of nonlocal nodes 0 count_lambda_function_nodes Count of lambda functions 3count_name_expression_nodes Count of name expression nodes 0Table 1
[0139] Second, node type feature analysis is directed to examining specific features of the code by categorizing them into different types, each highlighting a particular aspect of how the code functions. This categorization provides an understanding of both the complexity and efficiency of the code. Table 2 is an illustrative example of node type features analysis extracted from code snippets.Features Category Type Description Sample sklearn Library Usage List the machine learning and deep learning libraries used 0in the code snippet as '1 ' if they are included, and 'O' if they scikit-learn are not 0 xgboost 0 lightgbm 0 catboost 0 mlpack 0 h2o 0 statsmodels 0 tensorflow 0 keras 0 pytorch 0 theano 0 caffe 0 caffe2 0 pandas 1 numpy 1 tensorflow. keras 0 torchvision 0 tensorflow-datasets 0 cntk 0 mxnet 0 deeplearning4j 0 PyTorch 0sklearn. ensemble 1 sklearn. neighbors 0 sklearn. tree 0 sklearn. model_selection 1 sklearn. metrics 1 sklearn. feature_selection 0 sklearn. preprocessing 1 for Control Flow Count control flow "for" 5Structureswhile Count control flow "while" 0 if Count control flow "if' 1 ifExp Count control flow "ifExp" 1 int Data Types Count literal node "int" 95 str Count literal node "str" 195 float Count literal node "float' 11 bool Count literal node "bool" 12 bytes Count literal node "bytes" 0 NoneType Count literal node " NoneType" 1Function Calculate the total number of arguments used across all total_args_count 9Analysis functionsCount the total number of return statements used across function_returns_count 0all functionsCount the total number of return statements with specified function_with_return_type 0types used across all functionsCount the unique function call nodes that invoke defined unique_function_calls 77functionsTable 2
[0140] Third, the code quality metrics features refer to a set of measurements and indicators that help assess the overall quality of a code snippet. These metrics provide insights into various aspects of the code, such as its complexity and maintainability. By evaluating these metrics, developers can identify areas of improvement, understand code behavior, and make informed decisions about modifications or enhancements. These features typically include metrics that measure the volume of the code, the complexity of functions, the density of comments, and the potential maintainability of the software. Additionally, they help in predicting potential bugs, estimating the effort needed for future development or maintenance, and assessing the readability and manageability of thecode. Table 3 includes an exemplary array of code quality metrics features extracted from code snippets, each accompanied by a brief description and samples.Features Description Sample percent_lines_of_comments Calculate the percent of comment lines 27.54237288 loc The total number of lines of code 388 Hoc The number of logical lines of code 227 sloe The number of source lines of code 236..... The number of lines which represent multi-line _ multi - lines st.r.ingsr0 blankjines The number of blank lines 87 single_comments Count the number of single comments 65Store the Maintainability Index (MI), a software metric that assesses how easy the code snippet isto support and modify. A higher Ml score indicates.34360421 better maintainabilityCalculate the total Cyclomatic Complexity, which is program_cyclomatic_complexity determined by the number of decision numbers in a 8block of code,.... Calculate the average Cyclomatic Complexity func_complexity_avg_score - across all functionsx... Calculate the maximum Cyclomatic Complexity ~ func_complexity_max_score -r J- - across all functions,. Calculate the min Cyclomatic Complexity across all func_complexity_min_score -r- functions.... Calculate the variance Cyclomatic Complexity _ __________ func_complexity_variance -r J- across all functions,.xCount the number of functions that have a CC _ func_rank_a_count - - ranked as Ax -.. Count the number of functions that have a CCnfunc_rank_b_count - - ranked as B,.xCount the number of functions that have a CC „ func_rank_c_count - - ranked as Cx -.. Count the number of functions that have a CCnfunc_rank_d_count - - ranked as D,.xCount the number of functions that have a CC „ func_rank_e_count - - ranked as Ex i x * Count the number of functions that have a CCnfunc_rank_f_count - — ranked as F,, Total number of unique elements (operators and program_vocabulary operands).., Total number of elements used in the code, both program_length - operators and operandsprogram_halstead_volume Represents the size of the implementation 530.14089381JCEstimates how hard the code is to understand and „ „.n-,n„.nnprogram_difficulty - ’ maintain„. Represents the amount of work required to write the program_effort - codeprogram_time Estimates the time required to write the code 237.0548712, Provides an estimate of the number of errors in the program_bugs 0.1767136313avg_func_volume Calculate the average Volume across all functions 99.31702344 avg_func_difficulty Calculate the average Difficulty across all functions 1.444444444 avg_func_effort Calculate the average Effort across all functions 322.0752906Table 3
[0141] In some embodiments, Natural Language Processing (NLP)-based methods 608 include feature extraction based on similarity of code snippets. Determining the similarity between code snippets may be achieved by comparing the cosine similarity of the embedding vectors of different snippets. First, a code snippet is read as a string and then is preprocessed by removing irrelevant characters and tokens. Next, the code is sent to an embedding based on LLM to construct the embedding vector associated with the input snippet. These created embedding vectors are stored for each input code in a database. A code embedding module may then be used to create embedding vectors for all the available snippets as well as for any new unseen code snippets. The resulted vector may then be compared with all the snippets within the database to find the most similar one using, for example, cosine similarity.
[0142] When a new code snippet is processed, its embedding vector is compared with the embeddings of previously seen code snippets using cosine similarity. When a new code snippet is processed, its embedding vector is generated using an LLM (e.g., CodeBERT) and compared with previously stored embeddings in the database using cosine similarity. The closest match is identified, and its associated features, such as accuracy, F1 score, or MSE, are used as initial proxies for predicting the performance of the new code. This method enables efficient performance estimation for unseen code by leveraging prior analyses, reducing the need for retraining models. In some embodiments, this method may embeddings from a pre-trained transformer model (e.g., GPT models, Codex, or CodeBERT) fine-tuned on code datasets. The cosine similarity between embeddings of new and existing code snippets may provide a quantitative measure of similarity. The closest-matching snippet’s features and historical performance metrics are used as a proxy for the new snippet, making it possible to predict outcomes without retraining models. In some embodiments, the surrogate models may operate withoutretraining, for example, using pre-computed lookups, rule-based inference, or fixed embeddings.
[0143] In some embodiments, Natural Language Processing (NLP)-based methods 608 include feature extraction using Large Language Models (LLMs). Two types of features may be extracted from the snippets using LLMs, namely supportive features and predictive features. Generally, to extract each feature from the code snippet, a question is sent to the LLM model so that the returned answer is the feature to be used. For example, if the question “What is the name of the target column or variable?” is sent to the LLM and it returns “price”, indicating that the Machine Learning (ML) problem involves predicting the price for a certain item, the response will be used as a feature directly or indirectly for developing the surrogate model. Supportive features are not directly utilized in the surrogate model for making the predictions. Their purpose is to support other modules in extracting the features. The problem type (i.e., supervised, unsupervised, or semi-supervised learning problems) is an example of a supportive feature. Table 4 shows an exemplary summary of supportive features with sample values. Although this feature is not used directly for predictions in the surrogate model, this piece of information is essential in extracting features from datasets. Predictive features are extracted to be used directly in the surrogate model. These features can have a correlation with the carbon footprint of a model or its performance. Based on a given code snippet, predictive features extracted via the LLMs can describe the types of ML models at a high level, the models’ architectures, deep learning hyperparameters, and the general ML problem.Question to answer for creating the feature SampleIs it a Machine Learning (ML), Deep Learning (DL), or Reinforcement Learning (RL)? DL Is the Learning Approach Supervised, Unsupervised, or Semi-supervised? Supervised What are the file paths of all the datasets used? / input / doom-crossing What is the name of the target column or variable? NA Is the precision metric used? 0 Is the recall metric used? 0 Is the accuracy metric used? 1 Is the Fl score used? 0 Is the Mean Average Precision (MAP) used? 0 Is the Area Under the Receiver Operating Characteristic Curve (ROC AUC) used? 0 Is the Area Under the Precision-Recall Curve (PR AUC) used? 0s the R-Squared (R2) metric used? 0s the Root Mean Squared Error (RMSE) used? 0s the Mean Squared Error (MSE) used? 0Table 4
[0144] Predictive features may be extracted to be used directly in the surrogate model. These features can have a correlation with the carbon footprint of a model or its performance. Based on a given code snippet, predictive features extracted via the LLMs can describe the types of ML models at a high level, the models’ architecture, deep learning hyperparameters, and the general ML problem, as shown in Tables 5 to 8. Table 5 is an exemplary summary of the predictive features describing a machine learning model. Table 6 is an exemplary summary of the predictive features describing a model architecture. Table 7 is an exemplary summary of the predictive features describing deep learning hyperparameters. Table 8 is an exemplary summary of the predictive features describing a general machine learning problem. In some embodiments, functionally equivalent feature extraction techniques that produces comparable descriptive or predictive features may be substituted for the AST-based, NLP-based, baseline-model- based, CV-based, or spectral methods described herein.Questions for creating ML model features SampleIs Linear Regression used? 0Is Logistic Regression used? 0Are Decision Trees used? 0Are Random Forests used? 0Are Support Vector Machines (SVM) used? 0Is Naive Bayes used? 0Is K-Nearest Neighbors (KNN) used? 0Is K-Means Clustering used? 0Is Principal Component Analysis (PCA) used? 0Are Gradient Boosting Machines (GBM) used? 0Are Multi-Layer Perceptron (MLPs) used? 0Are Convolutional Neural Networks (CNNs) used? 0Are Recurrent Neural Networks (RNNs) used? 0Are Long Short-Term Memory (LSTMs) used? 0Are Gated Recurrent Units (GRUs) used? 0Are Autoencoders used? 0Are Generative Adversarial Networks (GANs) used? 0Are Transformers used? 0Are Residual Neural Networks (ResNets) used? 0Are Capsule Networks used? 0 Is Inception used? 0 IsVGG used? 0 Is Xception used? 0 Is EfficientNet used? 0 Is DenseNet used? 0 Is YOLO used? 0 Is Mask R-CNN used? 0 Is another ML model or DL model used? 0Table 5Questions for model architecture features Sample What is the number of model layers besides the pretrained model? 3 What are the input sizes of the linear layers (excluding any pretrained layers)? [1280, 1] What are the output sizes of the linear layers (excluding any pretrained layers)? [7, 7, 1280] Are any pretrained models used? 1 Is a pretrained MobileNet model used? 0 Is a pretrained ResNet model used? 1 Is a pretrained Inception model used? 0 Is a pretrained VGG model used? 0 Is a pretrained Xception model used? 0 Is a pretrained EfficientNet model used? 0 Is a pretrained DenseNet model used? 0 Is a pretrained YOLO model used? 0 Is a pretrained Mask R-CNN model used? 0 Is a pretrained BERT model used? 0 Is a pretrained GPT model used? 0 Is a pretrained RoBERTa model used? 0 Is another pretrained model used? 0 What is the input size? [224,224] What is the number of training epochs? 20 What is the training batch size? 16Table 6Questions for deep learning details Sample Is Stochastic Gradient Descent (SGD) used as the optimizer? 0 Is Mini-Batch Gradient Descent used as the optimizer? 0 Is Momentum used as the optimizer? 0 Is Nesterov Accelerated Gradient (NAG) used as the optimizer? 0 Is Adagrad used as the optimizer? 0 Is Adadelta used as the optimizer? 0 Is RMSprop used as the optimizer? 0Is Adam used as the optimizer? 1Is AdaMax used as the optimizer? 0Is Nadam used as the optimizer? 0Is AMSGrad used as the optimizer? 0Is AdaBound used asthe optimizer? 0Is AdamW used as the optimizer? 0Is Lookahead used as the optimizer? 0Is Stochastic Weight Averaging (SWA) used as the optimizer? 0Is another optimization technique used? 0Is a loss function used for training? 1Is the Mean Squared Error (MSE) loss function used? 0Is the Binary Cross-Entropy Loss function used? 1Is the Categorical Cross-Entropy Loss function used? 0Is the Hinge Loss function used? 0Is the Focal loss function or Dice loss function used? 0Is a learning rate scheduler used? 1What is the learning rate? 0.0001Is early stopping used? 0Is LI regularization used? 0Is L2 regularization used? 0Is dropout used? 1What is the dropout value? 0.3Is batch normalization used? 1Is Xavier uniform initialization used? 0Is Xavier normal initialization used? 0Is He uniform initialization used? 0Is He normal initialization used? 0Is a weight initialization technique other than Xavier or He used? 0Is gradient clipping used? 0Are loss weights for different classes / tasks used? 0What isthe number of training iterations? 0Is the ReLU activation function used? 0Is the Sigmoid activation function used? 0Is the Tanh activation function used? 0Is the Softmax activation function used? 0Is an activation function other than the above-mentioned functions used? 0Are data augmentation techniques used? 1Table 7Questions for creating ML model features SampleIs cross-validation employed? 0 If cross-validation is used, what is the number of folds or splits? 0 What isthe number of target classes? 2 Is it solving a classification problem? 1 Is it solving a regression problem? 0Is solving a clustering problem? 0Is solving an anomaly detection problem? 0Are the input data numerical? 0Are the input data categorical? 0Are the input data textual? 0Are the input data images? 1Are the input data audio? 0Are the input data video? 0Are the input data time series? 0Are the input data tabular? 0Are the input data of mixed types? 0Are the input data of any other type not mentioned above? 0Are techniques for handling imbalanced data used? 0Are external datasets used? 0Is the Cross-Validation Strategy used? 1What are the values of the Cross-Validation Strategy 0.3Are custom evaluation metrics used? 0Is another evaluation metric used? 0Is it a GPU-bound? 1Is it a CPU -bound? 0Is it mixed CPU-bound and GPU- bound? 0Is the prediction task binary classification? 1Is the prediction task multi-class classification? 0Is the prediction task multi-label classification? 0Is the prediction task regression? 0Is the prediction task NLP? 0Is the prediction task time series forecasting? 0Is the prediction task other than the above-mentioned tasks? 0Table 8
[0145] As has been appreciated by the inventors, the complexity of a deep learning project does not exclusively depend on the written code and algorithms but can also be significantly influenced by the dataset used to train the model. A rich dataset, for example, can provide accurate predictions even using simple deep learning models, while a sparse, low-quality dataset can undermine the performance of the most complex deep learning models.
[0146] Accordingly, the methods and systems descried herein also use datasets to characterize projects and aim to extract a complete set of features from project datasets. Three different approaches may be leveraged to analyze the datasets and create thefeatures, namely general feature extraction, baseline ML-model-based feature extraction, and computer vision (CV)-based feature extraction.
[0147] First, a set of features can be extracted from each dataset regarding the structure of the data using known methods. These features are referred to herein as general because they are common features shared by different datasets. Such general features include, but are not limited to, the number of rows of data, the ratio of numeric features to all other types of features, the average of the linear correlation coefficient between the numeric features, the percentage of duplicated values within the dataset, etc. Table 9 shows an exemplary set of general features that can be extracted from a dataset.Features Description Sample datasetjd A unique id that is assigned to each dataset altavish / boston- housing-dataset file_type Extension of the file that stores the csv file csv file_size_mb The size of the dataset in Megabytes 0.036 num_features Numberof features (columns) 14 num_rows Number of rows of data 394 numeric_features_ratio The ratio of numeric features to all the features. 1 mean_correlation_numeric_features The average of the linear correlation coefficient (Pearson 0.08correlation coefficient) between the numeric features. null_to_total_percentage Percentage of the null values to the total number of values 1.7in the datasetpercent_duplicates The percentage of the duplicated values within the dataset 54.41 mean_coefficient_variation Average of the coefficient of variation for each column 92(feature) of the datasetmax_largest_length_per_column Considering only the string values, the maximum numberof 20characters that exists in the databaseTable 9
[0148] Developing a baseline model is an effective approach to estimating the outcome of an underlying deep learning algorithm. A baseline model is a simple model used as a reference point to evaluate the performance of more complex models. A baseline model is typically a relatively simple and fast machine learning model that can provide insights about the outcome of a complex problem. Because such models are fast, insightful, and easy to train, the methods and systems disclosed herein use them in a novel way to generate features for surrogate models.
[0149] In some embodiments, two types of models, logistic / linear regression and decision trees are selected as baseline models, with their outputs serving as features. Typically, linear regression baseline models are used for regression tasks and decision tree baseline models are used for both classification and regression tasks. Such models serve as simple, interpretable baselines to compare against more complex deep learning models. Other models like logistic regression (for classification) and random forests can also be employed, depending on the problem. As will be appreciated by the skilled reader, any other suitable baseline model may also or instead be used.
[0150] FIG. 7 shows a block diagram representing a method 700 of extracting features from datasets using baseline machine learning models in accordance with embodiments of the present disclosure. The process starts with a dataset forming part of a project as the input.
[0151] At step 701, the dataset is preprocessed by using known processes, such as removing missing values, one-hot encoding, and normalizing numeric variables. Then, at step 702, the dataset is split into a training dataset and a testing dataset. The split may be performed by, for example, using the first 80% of the datapoints as a training dataset and the remaining 20% of the datapoints as a testing dataset, though other arrangements may be possible and appreciated by the skilled reader.
[0152] Before training the selected baseline machine learning models using the training dataset, the dataset feature extraction module 604 identifies the target variable and determines whether the deep learning model performs regression or classification. At step 703, this determination is based on supportive features extracted from code snippets via NLP-based methods, as described in more detail elsewhere herein. As an example, if the supportive feature indicates “supervised learning”, the system may identify a target variable such as “price” in a housing dataset and may classify the task as regression or classification based on data type (e.g., numerical or categorical). As another example, if performance metrics like accuracy or F1 score are used, the system may infer that the model involves classification. These determinations may in turn guide subsequent steps, such as selecting appropriate baseline models.
[0153] Next, at step 704, one or more baseline models are selected based on the nature of the problem determined at step 703 (also known herein as the nature of the deep learning model). Then, at step 705, the baseline models are trained using the training dataset. For example, if the problem is a regression task, a linear regression baseline model and a decision tree regressor baseline model are selected and trained using the training dataset.
[0154] Then, at step 706, the trained baseline models are evaluated using the testing dataset using known performance metrics such as, for example, Means Square Error (MSE), Root Mean Square Error (RMSE), Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), and R2metrics.
[0155] In another example, if a logistic regression and a decision tree classifier are selected and trained at steps 704 and 705, respectively, the testing dataset is then used to evaluate these baseline models in terms of accuracy and F1 score at step 706.
[0156] Finally, at step 707, the results of the model performance evaluation may be used as features. In each of the above examples, the values of the evaluation can be used as features extracted from the dataset and concatenated with the general feature. Table 9 shows exemplary features extracted from baseline models in accordance with an embodiment of the present disclosure.Features Description Sample linear_mse Mean squared error (MSE) based on linear regression baseline 28.84987278 linear_r2 R Squared parameter based on the linear regression baseline 0.5806563123 linear_mae Mean absolute error (MAE) based on linear regression baseline 3.484356256 linear_mape Mean absolute percentage error (MAPE) based on the linear regression 16.52586755 baselinelinear_rmse Root mean squared error (RMSE) based on the linear regression baseline 1.866643045 decisiontree_mse Mean squared error (MSE) based on the decision tree baseline 11.12088608 decisiontree_r2 R Squared parameter based on the decision tree baseline 0.8383537628 decisiontree_mae Mean absolute error (MAE) based on the decision tree baseline 2.282278481 decisiontree_mape Mean absolute percentage error (MAPE) based on the decision tree baseline 11.72703957 decisiontree_rmse Root mean squared error (RMSE) based on the decision tree baseline 1.510721179 logistic_accuracy Accuracy based on the logistic regression baseline 0.832logistic_f1_score F1 score based on the logistic regression baseline 0.735 decisiontree_accuracy Accuracy based on the decision tree baseline 0.854 decisiontree_f1_score F1 score based on the decision tree baseline 0.784Table 9
[0157] The general features generated from the dataset, as described elsewhere herein, can provide helpful information about the overall scheme of the dataset. Nevertheless, they are unable to provide insights about each specific dataset. In other words, different datasets have different number of columns, and if different features are generated for each column, the size of the features are always varying, which can result in a sparse dataset. In order to address this issue, the methods and systems described herein provide a second innovative feature extraction approach.
[0158] FIG. 8 shows a block diagram representing a method 800 of extracting features from datasets using computer vision-based (CV) machine learning models in accordance with embodiments of the present disclosure. The inventors have appreciated that, similarly to human beings, who can understand information about a dataset by looking at a summary of it, a CV engine using a machine learning model can understand a summary of a dataset and identify and extract information from it.
[0159] As described herein, this may be achieved by using the novel approach of extracting features from a specific layer of a pre-trained CV model, producing a fixed-size feature vector regardless of the size of the dataset. Table 10 comprises an exemplary dataset relating to residential houses.Price Area Bedrooms Mainroad 1,330,000 7420 4 yes 1,225,000 8960 4 yes 1,225,000 9960 3 yes 1,221,000 7500 4 yes 1,141,000 7420 4 yes 1,085,000 7500 3 yes Table 10
[0160] The method 800 of FIG. 8 begins with step 801, which is that of normalizing the dataset. More specifically, the numeric variables in the dataset may be normalized using known methods, while the non-numeric values remain unchanged.
[0161] In this process, a summary information is first generated from the dataset, capturing key statistical information about its columns, such as normalized numeric values, mean, variance, and other relevant metrics. Thus, at step 802, a summary table is then created based on the normalized data, which includes statistics for each column of the dataset. In some embodiments, the statistics may include, but are not limited to, the percentage of unique values, the percentage of most frequent value, the percentage of null values, the mean, the 25thpercentile, the median, etc. Table 11 comprises an exemplary summary table relating to the dataset of Table 10.Statistical Summary Price Area Bedrooms Mainroad % of unique values 0.4 0.5 0.011 0% of most frequent value 3.11 4.4 55.04 85.87 Percentage of null values 0 0 0 0 Mean 0.26 0.2 0.39 -1 25thpercentiles 0.14 0.1 0.2 -1 Median 0.22 0.2 0.4 -1 75thpercentiles 0.34 0.3 0.4 -1 STD 0.16 0.2 0.15 -1Table 11
[0162] The summary table is then converted into an image-like format by resizing it to a 224x224 grid and replicating the grid across three channels (similar to how an RGB image has three color channels) to match the input format typically required by Convolutional Neural Networks (CNNs). At step 803, image data is generated using the data in the summary table. In some embodiments, this is done by first assigning the value -1 to any features that do not have a value, and then resizing the summary table to 224 columns and 224 rows to replicate the format of an image. Many deep learning models in computer vision, particularly convolutional neural networks (CNNs), use 224x224 pixel images. Finally, as the input format of typical images has three channels, the summary table is replicated for each channel to match this format.
[0163] Then, at step 804, the generated image data is fed into a pre-trained computer vision model. For example, in some embodiments, the image data is fed into a VGG16 pre-trained CV model for processing. As will be appreciated by the skilled reader however, any other model suitable for processing image data may be used.
[0164] Then, at step 806, the method also comprises feeding the image data into a pre-trained convolutional neural network, extracting embeddings from a selected intermediate layer (e.g., Convolution 3-3 in VGG16), and using these embeddings as fixed-size feature representations of the dataset. These supplementary features can then be concatenated with the general features and the features extracted using the baseline ML method described in more detail elsewhere herein. As will be appreciated by the skilled reader, the size of the feature set varies depending on the intermediate layer chosen, as well as the structure of the selected model.
[0165] In some embodiments, in selecting the intermediate layer for feature extraction, a balance must be found between two important factors, namely that of the richness of information and the practical manageability. In other words, the intermediate layer should provide a large enough feature set to include all the relevant and meaningful statistical characteristics and patterns in the dataset. This ensures that the extracted features are comprehensive and can contribute to effective predictions. The feature set size should also however remain small enough to avoid computational inefficiencies and difficulties in managing the data.
[0166] By truncating the deep learning model and selecting an intermediate layer, the system effectively captures features without processing the entire model output, which might be unnecessarily large or unwieldy. For example, in a VGG16 pre-trained model, the Convolution 3-3 layer provides a concise yet informative 256-dimensional feature vector. This truncation ensures that the extracted features are both computationally efficient and sufficient for downstream tasks, such as surrogate model training or resource footprint estimation.
[0167] Thus, truncating the model at the intermediate layer not only optimizes resource utilization but also prevents overburdening the system with excessive or redundant information from deeper layers.
[0168] For example, in the embodiment using a VGG16 pre-trained CV model, the outputs of the Convolution 3-3 layer may be extracted to form a set of 256 features. Thus, once the dataset summary is transformed into this image format, it is fed into a pre-trained CNN model, such as the exemplary VGG16. Features are extracted from a specific layer of the CNN, such as the " Convolution 3-3" layer. The output of this layer is a fixed-size feature vector, regardless of the original size or complexity of the dataset. This feature vector (e.g., 256 features) captures the statistical characteristics and patterns in the dataset.
[0169] In accordance with some embodiments, the methods and systems of the present disclosure may make use of a novel multi-modal feature extraction technique, as now described with reference to Fig. 9. The method generates a dataset-level multimodal fingerprint that draws together graph-spectral heat-trace signatures, degree-density histograms, and distributional statistics from text and image embeddings, handled in a modality-agnostic manner.
[0170] Method 900 introduces a unified process for converting an entire dataset, whether composed of texts or images, into a single, stable, and modality independent vector representation. The approach goes beyond known embedding pipelines by integrating sample-level semantics, dataset-level geometry, distributional structure, and graph-based connectivity into one coherent fingerprint. The resulting vector is therefore not merely descriptive, but instead is engineered to serve as a predictive surrogate for the computational intensity and energy consumption of Al algorithms that will later operate on the same dataset. This dual functionality, where a dataset fingerprint simultaneously captures multimodal structure and enables energy-aware computation planning, distinguishes it from known representation learning methods.
[0171] The process begins at step 901 by scanning dataset directories and collecting the eligible samples in their entirety. This guarantees that the subsequent representation does not depend on manual selection or sampling heuristics. Next, at step 902, each file is embedded through a modality specific backbone selected by the caller. The method supports pluggable text embedding providers, which allows different semantic models to be used without altering the downstream stages. The methodpreserves flexibility, privacy, and extensibility, which are necessary for a process intended to be integrated into diverse workflows.
[0172] Then, at step 902, the methods includes L2 normalization of the embeddings. L2 normalization is a known technique for scaling a vector so that its Euclidean length (the L2 norm) becomes 1, without changing its direction. By ensuring that each sample vector has unit magnitude, the system removes the influence of superficial factors that would otherwise distort both structural and behavioral predictions. This normalization means that the representation captures the orientation of the data rather than arbitrary magnitude effects. It sets the stage for reliable geometric analysis and ensures that the graph structure built on top of the embeddings reflects true relational patterns rather than noise.
[0173] At step 904, a weighted k-nearest neighbor (k-NN) graph is produced, thereby introducing a relational layer that is absent from most dataset summarization techniques. A weighted k-NN graph is a graph constructed from a set of data points where each point is connected to its k most similar neighbors, and the edges carry weights that quantify the strength of those similarities. Using cosine similarity and Gaussian weights with a data-driven bandwidth, the method may produce a meaningful geometric scaffold that ties together semantically similar samples. As will be known to the skilled reader, a geometric scaffold is a simplified, structured representation that captures the essential shape, connectivity, or topology of a dataset, so that more detailed analysis, learning, or visualization can be built thereon.
[0174] From this scaffold, a normalized Laplacian is derived at step 905, and a multi-scale heat-trace signature is computed at step 906. A normalized Laplacian is a matrix representation of a graph that rescales the standard (unnormalized) graph Laplacian to account for node degrees. A multi-scale heat-trace signature is a compact, global descriptor of a graph or geometric object that summarizes its spectrum across multiple diffusion time scales. It is built from the heat kernel of the Laplacian and captures structural complexity in a way that is robust, multiscale, and easy to compare across objects.
[0175] In some embodiments, the use of Hutchinson probes and sparse operators may allow the method to extract global and local geometric information without expensive eigen decomposition. This choice provides significant gains in scalability. More importantly, the spectral signature captures structural properties that correlate with the computational behavior of machine learning algorithms, such as convergence difficulty, model sensitivity, and gradient propagation patterns.
[0176] In some embodiments, the creation of a degree histogram at step 907 may complement the spectral signature by preserving information about dataset connectivity, cluster formation, and heterogeneity. A degree histogram is a summary of how many nodes in a graph have each possible degree. This histogram acts as a low (computational) cost but high value summary of how densely or sparsely the dataset occupies its semantic space. The spectral features and the degree histogram forms a combined structural profile that conventional dataset metadata cannot provide.
[0177] In addition to relational geometry, the methods and systems of the present disclosure may compute distributional statistics across embedding dimensions at step 908. The element wise mean may encode the central semantic direction of the dataset, while the standard deviation may acknowledge the variability and spread of the representations. These descriptive statistics may serve as a bridge between the semantic content of the samples and the topological information captured by the graph.
[0178] In some embodiments, the final vector may be created by concatenating the spectral signature, the degree histogram, and the distributional statistics. A signed square-root transform may be applied to stabilize the distribution of values, followed by a final normalization step to ensure comparability across datasets of different sizes, types, or purposes.
[0179] One important point relating to this novel feature extraction approach lies in the fact that the resulting combined vector is not only a dataset fingerprint but also an actionable predictor of energy usage in Al pipelines. Existing techniques treat energy estimation as a function of algorithmic configuration, hardware constraints, or model architecture. Those approaches overlook the fundamental role of dataset geometry in determining computational load. For instance, datasets with complex topologies orirregular connectivity often require more compute-intensive optimization steps and therefore more energy. The present method uniquely quantifies this complexity directly in the dataset representation. The unified vector implicitly captures semantic diversity, geometric difficulty, and relational irregularities that strongly influence resource consumption in downstream tasks. Because of this, the same dataset-level vector can be fed into predictive models or rule-based systems designed to estimate energy cost before training or inference begins. The link between dataset structure and energy estimation is direct, measurable, and reproducible due to the deterministic nature of the pipeline.
[0180] This capability transforms the dataset fingerprint from a descriptive artifact into a predictive tool. It also enables entirely new classes of applications such as predeployment energy budgeting, real time scheduling of workloads according to sustainability constraints, intelligent routing of tasks to green-energy windows, and continuous environmental monitoring across the lifecycle of Al systems.
[0181] The incorporation of multi-scale spectral geometry, relational connectivity, and distributional semantics into a single modality-agnostic vector specifically for the purpose of energy prediction represents a novel fusion of ideas not present in existing literature or commercial systems.
[0182] Thus, the novel methods disclosed herein generates a dataset-level multimodal fingerprint that draws together graph-spectral heat-trace signatures, degreedensity histograms, and distributional statistics from text and image embeddings, handled in a modality-agnostic manner.
[0183] The method fuses three separate axes of information: code-structure fingerprints derived from AST analysis, the dataset-level multimodal fingerprint described above, and runtime or output signals from a baseline model. This fused representation enables prediction of computational workload, energy use, carbon emissions, water footprint, and expected model performance prior to running the target model.
[0184] In some embodiments, the code-derived features, dataset-level features, baseline-model outputs, and / or spectral or CV-based representations may be used individually or in any operative combination, and are not limited to being employed together.
[0185] In one example implementation of the methods and systems described herein, a user may develop a convolutional neural network (CNN) for an imageclassification task. The system automatically extracts features from the source code (e.g., number of layers, optimizer choice, convolution depth, activation functions) and features from the dataset (e.g., class distribution, statistical correlations). The dataset statistics may be further converted into a fixed-size image representation processed using a pretrained computer vision model to obtain dataset embedding.
[0186] The surrogate resource models may estimate that training the CNN for 30 epochs with a batch size of 64 on an NVIDIA A100 GPU will produce approximately 1.8 kg of CO2-equivalent emissions and consume 21 liters of water, based on the user’s selected region.
[0187] The surrogate performance models may estimate an expected accuracy of approximately 92%. The multi-objective optimizer determines that reducing the batch size to 32 and enabling mixed precision reduces energy usage by 18% while maintaining accuracy within 1% of the predicted performance. The system therefore generates a recommendation reflecting this tradeoff.
[0188] As discussed in more detail elsewhere herein, the system also includes a recommendation component that uses those predictions to suggest adjustments to hyperparameters, compute settings, or dataset selection in order to reduce environmental impact or improve performance. Moreover, the first surrogate model and the one or more second surrogate models may be implemented as a unified model or as distinct models, depending on the design choice.
[0189] While the applicant’s teachings described herein are in conjunction with various embodiments for illustrative purposes, it is not intended that the applicant’s teachings be limited to such embodiments as the embodiments described herein are intended to be examples. On the contrary, the applicant’s teachings described and illustrated herein encompass various alternatives, modifications, and equivalents, without departing from the embodiments described herein, the general scope of which is defined in the appended claims.
Claims
CLAIMS1. A method of modifying parameters of a deep learning algorithm, the method comprising:extracting features from code and one or more datasets relating to the deep learning algorithm;feeding the extracted features into a first surrogate machine learning model and one or more second surrogate machine learning models, wherein the first surrogate machine learning model outputs information relating to a prediction of the resource footprint of executing the deep learning algorithm and the one or more second surrogate machine learning models output information relating to a prediction of the efficiency and performance of the deep learning algorithm;estimating the resource footprint of executing the deep learning algorithm based at least in part on the information relating to the prediction of the resource footprint;estimating the efficiency and performance of executing the deep learning algorithm based at least in part on the information relating to the prediction of the efficiency and performance; anddetermining, based on the estimate of the resource footprint and the estimate of the estimate of the efficiency and performance, at least one recommendation to modify one or more parameters of the deep learning algorithm to reduce the resource footprint of the deep leaning algorithm while increasing or maintaining the efficiency and performance of the deep learning algorithm.
2. The method of claim 1 further comprising:determining geographic location information of a computing resource used to execute the deep learning algorithm; anddetermining resource intensity information relating to the resource intensity of executing the deep learning algorithm based in part on the geographic location information, and using the resource intensity, wherein the step of estimating the resource footprint of executing the deep learning algorithm is also based on the resource intensity information.
3. The method of claim 2, wherein determining at least one recommendation includes multi-objective optimization which minimizes energy consumption while ensuring performance metrics remain above a certain threshold.
4. The method of claim 3, wherein the method further comprises setting weights in the multi-objective optimization relating to how much emphasis is placed on reducing resource footprint versus ensuring performance.
5. The method of any one of claims 1 to 4, wherein each of the one or more second surrogate machine learning models is trained to predict a different performance metric from within a plurality of performance metrics.
6. The method of claim 5, wherein the plurality of performance metrics including one or more of recall, F1-score, Mean Absolute Error, Mean Squared Error, Root Mean Squared Error, and R-squared.
7. The method of any one of claims 1 to 6, wherein extracting features from code and one or more datasets relating to the deep learning algorithm includes extracting features from the code using a rule-based feature extraction method.
8. The method of any one of claims 1 to 7, wherein extracting features from code and one or more datasets relating to the deep learning algorithm includes extracting features from the code using a natural language processing feature extraction method.
9. The method of any one of claims 1 to 8, wherein extracting features from code and one or more datasets relating to the deep learning algorithm includes extracting features from the dataset using baseline machine learning algorithm feature extraction.
10. The method of claim 9, wherein extracting features from the dataset using baseline machine learning algorithm feature extraction includes:separating the dataset into a training dataset and a testing dataset; determining the target variable of the deep learning model and the nature of the deep learning model;selecting one or more baseline machine learning models based on the nature of the deep learning model;training the one or more baseline machine learning models using the training dataset;evaluating the performance of the one or more baseline machine learning models using the testing data set using one or more performance metrics; andusing the evaluation results as features of the dataset.
11. The method of any one of claims 1 to 10, wherein extracting features from code and one or more datasets relating to the deep learning algorithm includes extracting features from the dataset using computer vision-based feature extraction.
12. The method of claim 11, wherein extracting features from the dataset using computer vision-based feature extraction includes:creating summary information of the dataset;generating image data using the summary information;feeding the image data into a neural network;extract the outputs of an intermediate layer of the neural network; andusing the outputs of the intermediate layer as features of the dataset.
13. The method of any one of claims 1 to 9, wherein extracting features from the dataset includes:generating a graph-spectral heat-trace signature of the data set; and generating a degree-density histograms using the dataset.
14. The method of claim 13, wherein the method further includes generating distributional statistics from text and image embeddings of the data set.
15. A non-transitory computer program product comprising computer-implemented instructions to cause a computer system to execute the method of any one of claims 1 to 14.
16. A computer system comprising one or more computer processors and one or more computer readable storage media for storing computer-implemented instructions, wherein the one or more computer processors are configured to execute the computer-implemented instructions to cause the system to perform the method of any one of claims 1 to 14.
17. A method of extracting features from a dataset used to train a deep learning model, the method comprising:separating the dataset into a training dataset and a testing dataset; determining the target variable of the deep learning model and the nature of the deep learning model;selecting one or more baseline machine learning models based on the nature of the deep learning model;training the one or more baseline machine learning models using the training dataset;evaluating the performance of the one or more baseline machine learning models using the testing data set using one or more performance metrics; andusing the evaluation results as features of the dataset.
18. The method of claim 17, wherein the nature of the deep learning model is regression.
19. The method of claim 18, wherein the one or more baseline machine learning models include one or more of a linear regression baseline model and a decision tree regressor baseline model.
20. The method of any one of claims 17 to 19, wherein the one or more performance metrics include one or more of Means Square Error, Root Mean Square Error, Mean Absolute Error, Mean Absolute Percentage Error, and R-squared.
21. The method of claim 17, wherein the nature of the deep learning model is classification.
22. The method of claim 21, wherein the one or more baseline machine learning models includes one or more of a logistic regression baseline machine learning model and a decision tree classifier machine learning model.
23. The method of claim 22, wherein the one or more performance metrics include one or more of accuracy and F1 score.
24. A non-transitory computer program product comprising computer-implemented instructions to cause a computer system to execute the method of any one of claims 17 to 23.
25. A computer system comprising one or more computer processors and one or more computer readable storage media for storing computer-implemented instructions, wherein the one or more computer processors are configured to execute the computer-implemented instructions to cause the system to perform the method of any one of claims 17 to 23.
26. A method of extracting features from a dataset, the method comprising:creating summary information of the dataset;generating image data using the summary information;feeding the image data into a neural network;extracting the outputs of an intermediate layer of the neural network; and using the outputs of the intermediate layer as features of the dataset.
27. The method of claim 26, wherein the summary information includes a statistical table relating to the columns of the dataset.
28. The method of claim 27, wherein the statistical table includes one or more of normalized numeric values, mean, and variance of values for each column in the dataset.
29. The method of any one of claims 26 to 28, wherein generating image data using the summary information includes resizing the summary information to replicate the format of an image.
30. A non-transitory computer program product comprising computer-implemented instructions to cause a computer system to execute the method of any one of claims 26 to 29.
31. A computer system comprising one or more computer processors and one or more computer readable storage media for storing computer-implemented instructions, wherein the one or more computer processors are configured to execute the computer-implemented instructions to cause the system to perform the method of any one of claims 26 to 30.
32. A method of extracting features from a dataset used to train a deep learning model, the method comprising:generating a graph-spectral heat-trace signature of the data set; and generating a degree-density histograms using the dataset.
33. The method of claim 32, wherein the method further includes generating distributional statistics from text and image embeddings of the data set.
34. A non-transitory computer program product comprising computer-implemented instructions to cause a computer system to execute the method of any one of claims 32 to 33.
35. A computer system comprising one or more computer processors and one or more computer readable storage media for storing computer-implemented instructions, wherein the one or more computer processors are configured to execute the computer-implemented instructions to cause the system to perform the method of any one of claims 32 to 34.
Citation Information
Patent Citations
Automated model management methods
US10209974B1
Carbon-aware code optimization
US11803375B2
Shape-based graphics search
US20190197133A1
Classifying Structural Features of a Digital Document by Feature Type using Machine Learning
US20200302016A1
Green artificial intelligence implementation
US20210374561A1