37 Xiao Luban: A Machine‑Learning Linear Regression System for Automatic Banner Generation
The article describes a PHP engineer who built a machine‑learning linear regression system called 37 Xiao Luban to automatically generate game banner images, cutting production time from hours to minutes, using polynomial regression on collected scaling data, achieving 80‑90% usability.
The author, a PHP engineer with a strong interest in artificial intelligence, revisited fundamental mathematics (derivatives, matrices, probability) and studied machine‑learning algorithms (classification, regression, clustering) as well as deep‑learning models (CNN, RNN). After acquiring this knowledge, he created an AI‑driven application called “37 Xiao Luban”.
Problem background : Graphic designers in the game studio spend up to five hours manually creating hundreds of banner images of different sizes for each new game. This repetitive, low‑value work limits productivity.
Solution overview : 37 Xiao Luban uses a machine‑learning model to automatically generate banner images of various dimensions, reducing the manual effort from five hours to about thirty minutes per game. The system outputs banner samples (illustrated in the original article).
Design concept : Analysis of existing banners revealed three common elements – background, character, and game logo (sometimes only background and logo). The generation process can be modeled as a regression problem: given the target image size, predict the original image scaling factor, logo position and scale, and cropping coordinates. A linear regression model is employed to learn these relationships.
Data collection : To obtain training data, the author collaborated with a C++ developer who built a graphical tool. Users load background, character, and logo images, adjust scaling, and capture 25 variants of different sizes. These generated samples constitute the dataset for model training.
Model training and evaluation : The dataset is fed into scikit‑learn’s LinearRegression. Because a simple linear model is insufficient, polynomial features ( PolynomialFeatures) are added to improve fitting. Grid search is used for hyper‑parameter optimization. Model performance is assessed using the R² score and the percentage of predictions that stay within the data range, providing a weighted metric to avoid over‑fitting.
Image generation pipeline : After training, the optimal model is serialized to a file. The graphical tool integrates the model, and a server‑side API allows the client to trigger batch image generation. Generated images can be downloaded directly from the client interface.
Results and future work : In practice, 37 Xiao Luban reduces the time to produce 100 banner images from four‑to‑five hours to roughly thirty minutes, achieving an image usability rate of 80‑90%. Future improvements may include finer model tuning, exploring back‑propagation neural networks, or other deep‑learning techniques, as well as enhancing the user interface to further minimize manual steps.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
